fmt: support %w
When fmt.Errorf is provided with a %w verb with an error operand, return an error implementing an Unwrap method returning that operand. It is invalid to use %w with other formatting functions, to use %w multiple times in a format string, or to use %w with a non-error operand. When the Errorf format string contains an invalid use of %w, the returned error does not implement Unwrap. Change-Id: I534e20d3b163ab22c2b137b1c9095906dc243221 Reviewed-on: https://go-review.googlesource.com/c/go/+/176998Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Showing
src/fmt/errors.go
0 → 100644
src/fmt/errors_test.go
0 → 100644
Please register or sign in to comment