Documentation ¶
Overview ¶
Package errlist contains an ErrList type that combines multiple errors into a single error. The package draws inspiration from hashicorp's go-multierror package (https://github.com/hashicorp/go-multierror).
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromStrings ¶
FromStrings converts a list of error strings (e.g., when received in a serialized message) into an ErrList.
Types ¶
type ErrList ¶
type ErrList []error
ErrList holds a list of errors.
Example ¶
var errs ErrList errs = append(errs, fmt.Errorf("We looked!")) errs = append(errs, fmt.Errorf("And we saw him!")) errs = append(errs, fmt.Errorf("The Cat in the Hat!")) var err error = errs.ErrorOrNil() fmt.Println(err)
Output: We looked! And we saw him! The Cat in the Hat!
func (ErrList) ErrorOrNil ¶
ErrorOrNil returns a single error that includes all of the errors in the provided ErrList, or nil if there are no errors.
Click to show internal directories.
Click to hide internal directories.