Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooManyErrors = errors.New("too many errors")
ErrTooManyErrors is added to the ErrorList by the Trim method.
Functions ¶
This section is empty.
Types ¶
type ErrorList ¶
type ErrorList []error
ErrorList wraps multiple errors as a single error.
func (ErrorList) Append ¶
Append an error to the list.
If err is an instance of ErrorList, the lists are concatenated together, otherwise err is appended at the end of the list. If err is nil, the list is returned unmodified.
err := DoStuff() errList := errList.Append(err)
func (ErrorList) AppendDistinct ¶
AppendDistinct is similar to Append, but doesn't append the error if it has the same message as the last error on the list.
Click to show internal directories.
Click to hide internal directories.