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:
Arthur Befumo 2019-11-08 13:29:00 -05:00 committed by Abhinav Gupta
parent 824d08f797
commit 0603dab385
1 changed files with 1 additions and 1 deletions

View File

@ -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)