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.

Comment From: gabyhelp

Related Issues

Related Code Changes

Related Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)