mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
4a0a2b33df
An error which implements an "Unwrap() []error" method wraps all the non-nil errors in the returned []error. We replace the concept of the "error chain" inspected by errors.Is and errors.As with the "error tree". Is and As perform a pre-order, depth-first traversal of an error's tree. As returns the first matching result, if any. The new errors.Join function returns an error wrapping a list of errors. The fmt.Errorf function now supports multiple instances of the %w verb. For #53435. Change-Id: Ib7402e70b68e28af8f201d2b66bd8e87ccfb5283 Reviewed-on: https://go-review.googlesource.com/c/go/+/432898 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Rob Pike <r@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> |
||
---|---|---|
.. | ||
doc.go | ||
errors.go | ||
errors_test.go | ||
example_test.go | ||
export_test.go | ||
fmt_test.go | ||
format.go | ||
gostringer_example_test.go | ||
print.go | ||
scan.go | ||
scan_test.go | ||
state_test.go | ||
stringer_example_test.go | ||
stringer_test.go |