@@ -212,22 +212,21 @@ func asType[E error](err error, ppe **E) (_ E, _ bool) {
212212// The tree consists of err itself, followed by the errors obtained by repeatedly
213213// calling its Unwrap() error or Unwrap() []error method. When err wraps multiple
214214// errors, IsAny examines err followed by a depth-first traversal of its children.
215- //
216- // IsAny returns true if [Is](err, target) returns true for any target in targets.
217215func IsAny (err error , targets ... error ) bool {
218216_ , found := match (err , targets )
219217
220218return found
221219}
222220
223- // Match returns the matched error in targets for err.
221+ // Match returns the first target error from targets that matches any error in err's tree .
224222//
225223// The tree consists of err itself, followed by the errors obtained by repeatedly
226224// calling its Unwrap() error or Unwrap() []error method. When err wraps multiple
227225// errors, Match examines err followed by a depth-first traversal of its children.
228226//
229- // Match returns the first target error for which [Is](err, target) returns true.
230- // If no target matches, Match returns nil.
227+ // Match returns the first target from targets if an err is equal to that target or if
228+ // it implements a method Is(error) bool such that Is(target) returns true.
229+ // If no target matches the err, Match returns nil.
231230func Match (err error , targets ... error ) error {
232231matched , _ := match (err , targets )
233232
0 commit comments