package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Mar 7, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 32
Opens a new window with list of known importers.
README
¶
errors
errors provides utility routines for working with errors that are compatible with go 1.13+.
It currently provides:
errors.M
which can be used to store multiple error values. errors.M
is thread safe.
errs := errors.M{}
...
errs.Append(fn(a))
...
errs.Append(fn(b))
...
err := errs.Err()
Documentation
¶
Unwrap calls errors.Unwrap.
M represents multiple errors. It is thread safe. Typical usage is:
errs := errors.M{}
...
errs.Append(err)
...
return errs.Err()
func (m *M) Append(errs ...error)
Append appends the specified errors excluding nil values.
func (m *M) As(target interface{}) bool
As supports errors.As.
Clone returns a new errors.M that contains the same errors as itself.
Err returns nil if m contains no errors, or itself otherwise.
Error implements error.error
Format implements fmt.Formatter.Format.
Unwrap implements errors.Unwrap. It returns the first stored error
and then removes that error.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.