tailscale/util/multierr
Joe Tsai c47578b528
util/multierr: add Range (#6643)
Errors in Go are no longer viewed as a linear chain, but a tree.
See golang/go#53435.

Add a Range function that iterates through an error
in a pre-order, depth-first order.
This matches the iteration order of errors.As in Go 1.20.

This adds the logic (but currently commented out) for having
Error implement the multi-error version of Unwrap in Go 1.20.
It is commented out currently since it causes "go vet"
to complain about having the "wrong" signature.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-12-12 16:48:11 -08:00
..
multierr_test.go util/multierr: add Range (#6643) 2022-12-12 16:48:11 -08:00
multierr.go util/multierr: add Range (#6643) 2022-12-12 16:48:11 -08:00