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 Fatalf ¶
Fatalf writes a message to stderr, and then calls os.Exit(1). Arguments are handled in the manner of fmt.Fprintf. If format does not end in a newline, this function adds one.
func IntToBool ¶ added in v0.2.0
IntToBool converts an int to a bool. It returns true if i is nonzero, and false if i is zero.
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.