Documentation
¶
Overview ¶
Package mu (mini utility) contains miscellaneous utility functions that are generally useful for most projects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolToInt ¶ added in v0.2.0
BoolToInt converts a bool to int. It returns 1 if b is true and 0 if b is false.
func Fatalf ¶
Fatalf writes a message to stderr, and then calls os.Exit(1). Arguments are handled in the manner of fmt.Fprintf.
func Panicf ¶
Panicf invokes panic() with a message. Arguments are handled in the manner of fmt.Sprintf.
func UNUSED ¶
func UNUSED(v ...any)
UNUSED is a noop function that is primarily used during development to silence build errors of the form "variable x declared and not used." UNUSED takes a variable number of arguments, and thus may silence such errors for multiple variables with a single call.
Example:
a, b, err = foo() if err != nil { mu.Fatalf("error: %v", err) } mu.UNUSED(a, b)
Types ¶
This section is empty.