package errutil
import "src.elv.sh/pkg/errutil"
Package errutil contains common error-related utilities.
Index ¶
Functions ¶
func Multi ¶
Multi combines multiple errors into one:
If all errors are nil, it returns nil.
If there is one non-nil error, it is returned.
Otherwise, the return value is an error whose Error methods contain all the messages of all non-nil arguments.
If the input contains any error returned by Multi, such errors are flattened. The following two calls return the same value:
Multi(Multi(err1, err2), Multi(err3, err4)) Multi(err1, err2, err3, err4)
Source Files ¶
errutil.go multi_error.go
- Version
- v0.21.0 (latest)
- Published
- Aug 13, 2024
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 day ago –
Tools for package owners.