-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
errors.Join
docs are terse on how to inspect joined errors. My initial approach, upon reading the following passage
// A non-nil error returned by Join implements the Unwrap() []error method.
was to do something like this:
if joined, ok := err.(interface{ Unwrap() []error }); ok {
for _, err := range joined.Unwrap() {
...
}
}
Only by reading the docs for errors.Is
and errors.As
I realized that they can deal with "joined" errors. Let's consider adding a passage to errors.Join
such as:
// Joined errors can be inspected through Is and As.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.