Skip to content

Commit 0603dab

Browse files
Arthur-Befumoabhinav
authored andcommitted
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`.
1 parent 824d08f commit 0603dab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ type errorGroup interface {
130130
}
131131

132132
// Errors returns a slice containing zero or more errors that the supplied
133-
// error is composed of. If the error is nil, the returned slice is empty.
133+
// error is composed of. If the error is nil, a nil slice is returned.
134134
//
135135
// err := multierr.Append(r.Close(), w.Close())
136136
// errors := multierr.Errors(err)

0 commit comments

Comments
 (0)