Documentation ¶
Overview ¶
The but package provides helpers for handling messages while at the bottom of the call stack.
Index ¶
- func Fail(args ...interface{})
- func Failf(format string, args ...interface{})
- func IfError(err error, args ...interface{}) bool
- func IfErrorf(err error, format string, args ...interface{}) bool
- func IfFatal(err error, args ...interface{})
- func IfFatalf(err error, format string, args ...interface{})
- func Log(args ...interface{})
- func Logf(format string, args ...interface{})
- type Errors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Failf ¶
func Failf(format string, args ...interface{})
Failf formats the arguments according to format, prints the result to stderr, and exits.
func IfError ¶
IfError prints err to stderr if the error is non-nil. Extra arguments are converted to a string which, if present, annotates the error. Returns true if the error is non-nil.
func IfErrorf ¶
IfErrorf prints err to stderr if the err is non-nil. Extra arguments are formatted as a string, according to the format argument. If present, this string annotates the error. Returns true if the error is non-nil.
func IfFatal ¶
func IfFatal(err error, args ...interface{})
IfFatal prints err to stderr and exits, if the error is non-nil. Extra arguments are converted to a string which, if present, annotates the error.
Types ¶
type Errors ¶
type Errors struct { // Msg is an optional message to be displayed before the list of errors. Msg string // Errs is the list of errors. Errs []error }
Errors groups together multiple errors as a single error.