multierror

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errors

func Errors(err error) []error

Errors return the underlying errors, if possible. An error value has a errors if it implements the following interface:

type errors interface {
       Errors() []error
}

If the error does not implement Errors, the original error will be returned like []error{err}. If the error is nil, nil will be returned without further investigation.

Types

type Builder

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

Builder contained errors and supports thread-safe addition of errors

func (*Builder) Add

func (m *Builder) Add(err error)

Add error (thread-safe), if err is nil, nothing will be added.

func (*Builder) ToError

func (m *Builder) ToError() error

ToError returns one error contained many errors or nil if no errors

Jump to

Keyboard shortcuts

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