Documentation ¶
Overview ¶
Package errs provides error wrapping functions that allow an error to wrap multiple other errors. The error wrapping in the Go standard library allows an error to wrap only one error with only one %w format verb in the format string passed to fmt.Errorf and the errors.Unwrap() function that returns only a single error.
The error type returned by the functions in this package wraps multiple errors so that errors.Is() and errors.As() can be used to query if that error is any one of the wrapped errors. errors.Unwrap() on errors of that type always returns nil as that function cannot return multiple errors.
The error type is not exported so is used through the standard Go error interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
Errorf returns an error formatted with a format string and arguments, similar to how fmt.Errorf works. The error returned by Errorf wraps each argument that is an error type unless that error argument is marked with the Nowrap() function. The %w format verb should not be used in the format string.
Types ¶
This section is empty.