multierr

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(left, right error) error

Append appends the given errors together. Either value may be nil.

This function is a specialization of Combine for the common case where there are only two errors.

func Combine

func Combine(errors ...error) error

Combine combines the passed errors into a single error.

If zero arguments were passed or if all items are nil, a nil error is returned.

If only a single error was passed, it is returned as-is.

Combine skips over nil arguments so this function may be used to combine errors from operations that fail independently of each other.

If any of the passed errors is an errorGroup error, it will be flattened along with the other errors.

func Errors

func Errors(err error) []error

Errors returns a slice containing zero or more errors the supplied error is composed of. If the error is nil, a nil slice is returned.

If the error is not composed of the errors (do not implement errorGroup interface with Errors method), the returned slice contains just the error that was padded in.

Callers of this function are free to modify the returned slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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