Documentation ¶
Overview ¶
Package multierror provides a type that can translate multiple errors into a Go error interface.
A common use of this package is as follows.
errs := multierror.New() for i := range stuff { err := doThing(i) errs.Add(err) } return errs.ErrOrNil()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiError ¶
type MultiError []error
MultiError holds a list of error's, that could potentially be empty.
Use New() to create a MultiError.
func (*MultiError) Add ¶
func (m *MultiError) Add(err error)
Add adds an error to the MultiError. The provided err must not be nil.
func (MultiError) ErrOrNil ¶
func (m MultiError) ErrOrNil() error
ErrOrNil returns either nil, if there are no errors in this MultiError, or an error, otherwise.
func (MultiError) Error ¶
func (m MultiError) Error() string
Error implements the error.Error() interface method.
Click to show internal directories.
Click to hide internal directories.