lang

package
v0.0.0-...-4873089 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSONUnmarshal     = jsoniter.Unmarshal
	JSONMarshal       = jsoniter.Marshal
	JSONMarshalIndent = jsoniter.MarshalIndent
)

nolint gochecknoglobals

View Source
var (
	DebugGoroutines = os.Getenv("DEBUG_GOROUTINES") == "1"
)

nolint gochecknoglobals

Functions

func Closef

func Closef(err *error, closer io.Closer, format string, a ...interface{})

Closef runs function and on error return error by argument including the given error (usually from caller function).

func M1

func M1(a, b interface{}) []interface{}

M1 shims for 1 param return values

func M2

func M2(a, b interface{}) []interface{}

M2 shims for 2 param return values

func M3

func M3(a, b, c interface{}) []interface{}

M3 shims for 3 param return values

func M4

func M4(a, b, c, d interface{}) []interface{}

M4 shim for 4 param return values

func M5

func M5(a, b, c, d interface{}) []interface{}

M5 shim for 5 param return values

func ParseTime

func ParseTime(layout, value string) time.Time

Parse parses a formatted string and returns the time value it represents. If parse failed, the zero value is returned.

func TmplRenderText

func TmplRenderText(tmpl string, data interface{}) (string, error)

TmplRenderText renders the tmpl template with data.

Types

type GoroutineID

type GoroutineID string

GoroutineID is the goroutine ID's presentation.

func CurGoroutineID

func CurGoroutineID() GoroutineID

CurGoroutineID returns the current goroutine ID.

func NewGoroutineLock

func NewGoroutineLock() GoroutineID

NewGoroutineLock return a new goroutine lock.

func (GoroutineID) Check

func (g GoroutineID) Check()

Check checks that the current goroutine is on.

func (GoroutineID) CheckNotOn

func (g GoroutineID) CheckNotOn()

CheckNotOn checks that the current goroutine is not on.

func (GoroutineID) Uint64

func (g GoroutineID) Uint64() uint64

Uint64 return current goroutine ID's uint64 type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL