Documentation
¶
Overview ¶
Package multierror defines an error Accumulator to contain multiple errors.
Use Uber's Multierr ¶
It has a cleaner and more consistent design than this package: https://godoc.org/go.uber.org/multierr
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accumulator ¶
type Accumulator []error
Accumulator is an error accumulator.
Usage:
var errors multierror.Accumulator errors.Push(returnsErrOrNil()) errors.Push(returnsErrOrNil()) errors.Push(returnsErrOrNil()) return errors.Error()
func (*Accumulator) Error ¶
func (m *Accumulator) Error() error
Error returns the accumulated errors. If no errors have been pushed onto the accumulator, then nil will be returned.
func (*Accumulator) Push ¶
func (m *Accumulator) Push(err error)
Push adds an error to the Accumulator. If err is nil, then Accumulator is not affected.
func (*Accumulator) Pushf ¶
func (m *Accumulator) Pushf(fmtstr string, args ...interface{})
Pushf adds a formatted error string to the Accumulator. It is a shortcut for Push(fmt.Error(...)).
func (Accumulator) String ¶
func (m Accumulator) String() string
String prints the accumulated errors or "nil" if no errors have been pushed.
Click to show internal directories.
Click to hide internal directories.