mul
go.uber.org/multierr
go get go.uber.org/multierr
mul

go.uber.org/multierr

Package multierr allows combining one or more errors together. Errors can be combined with the use of the Combine function. If only two errors are being combined, the Append function may be used instead. The underlying list of errors for a returned error object may be retrieved with the Errors function. You sometimes need to append into an error from a loop. Cases like this may require knowledge of whether an individual instance failed. This usually requires introduction of a new variable. multierr includes AppendInto to simplify cases like this. This will append the error into the err variable, and return true if that individual error was non-nil. See AppendInto for more information. Go makes it possible to modify the return value of a function in a defer block if the function was using named returns. This makes it possible to record resource cleanup failures from deferred blocks. multierr provides the Invoker type and AppendInvoke function to make cases like the above simpler and obviate the need for a closure. The following is roughly equivalent to the example above. See AppendInvoke and Invoker for more information. Errors returned by Combine and Append MAY implement the following interface. Note that if you need access to list of errors behind a multierr error, you should prefer using the Errors function. That said, if you need cheap read-only access to the underlying errors slice, you can attempt to cast the error to this interface. You MUST handle the failure case gracefully because errors returned by Combine and Append are not guaranteed to implement this interface.

by unknownv1.8.0 (see all)License:MIT
go get go.uber.org/multierr
Readme

multierr GoDoc Build Status Coverage Status

multierr allows combining one or more Go errors together.

Installation

go get -u go.uber.org/multierr

Status

Stable: No breaking changes will be made before 2.0.


Released under the MIT License.

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

0

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
v1.8.0
7mos ago
v0.0.0-20201027220001-0eb6eb5383b9
1yr ago
v0.0.0-20201124182017-e015acf18bb3
1yr ago
v1.7.1-0.20210712175728-d49c2ba57443
1yr ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate