Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiErr ¶
type MultiErr struct {
// contains filtered or unexported fields
}
MultiErr is a struct for collecting multiple errors. Create a new one by calling New.
func (*MultiErr) CollectIfNotNil ¶
CollectIfNotNil will collect the given error if it is not nil.
func (c MyComponent) Close() error { errs := multierror.New() errs.CollectIfNotNil(c.field1.Close()) errs.CollectIfNotNil(c.field2.Close()) errs.CollectIfNotNil(c.field3.Close()) errs.CollectIfNotNil(c.field4.Close()) return errs.OrNil() }
Click to show internal directories.
Click to hide internal directories.