multierror

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(err error, errs ...error) error

Append will combine all errors into a single error. Any nil errors will be skipped, only actual errors are retained. If only one error is supplied it will be returned directly. If no error is supplied the function will return nil. Otherwise an Error will be returned containing the errors as sub-errors.

func ForEach added in v0.5.0

func ForEach(err error, f func(err error))

ForEach takes err, extracts sub-errors and calls f with each sub-error. If err does not contain multiple errors, f is called with err itself.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is an error that contains multiple sub-errors.

func (*Error) Error

func (e *Error) Error() string

Error formats all sub-error messages into a string separated with new lines.

func (*Error) Errors

func (e *Error) Errors() []error

Errors returns all underlying errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL