mirror of https://github.com/uber-go/multierr.git
docs: multierr.Errors returns nil, not empty (#33)
Previously the docs incorrectly stated that `multierr.Errors(err)`
would return an empty slice rather than a nil slice, which would imply
that `multierr.Errors(nil) == []error{}`, which isn't true.
This updates the docs to reflect reality: `multierr.Errors(nil) == nil`.
This commit is contained in:
parent
824d08f797
commit
0603dab385
2
error.go
2
error.go
|
|
@ -130,7 +130,7 @@ type errorGroup interface {
|
|||
}
|
||||
|
||||
// Errors returns a slice containing zero or more errors that the supplied
|
||||
// error is composed of. If the error is nil, the returned slice is empty.
|
||||
// error is composed of. If the error is nil, a nil slice is returned.
|
||||
//
|
||||
// err := multierr.Append(r.Close(), w.Close())
|
||||
// errors := multierr.Errors(err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue