1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:44:43 -07:00
go/src/fmt
Damien Neil 14491a2ec4 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/+/176998
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2019-05-15 19:53:28 +00:00
..
doc.go errors, fmt: revert rejected changes for Go 1.13 2019-05-15 19:53:15 +00:00
errors_test.go fmt: support %w 2019-05-15 19:53:28 +00:00
errors.go fmt: support %w 2019-05-15 19:53:28 +00:00
example_test.go fmt: fix spelling mistake in example 2019-03-25 21:03:10 +00:00
export_test.go
fmt_test.go fmt: format 0b, 0o prefixes in %#b and %O 2019-02-26 05:16:56 +00:00
format.go errors, fmt: revert rejected changes for Go 1.13 2019-05-15 19:53:15 +00:00
gostringer_example_test.go fmt: add example for GoStringer interface 2018-09-06 04:25:17 +00:00
print.go fmt: support %w 2019-05-15 19:53:28 +00:00
scan_test.go fmt: scan new number syntax 2019-02-26 05:18:24 +00:00
scan.go fmt: rename buffer.WriteByte to writeByte 2019-05-09 17:49:12 +00:00
stringer_example_test.go fmt: add an example for Errorf 2018-08-30 19:40:13 +00:00
stringer_test.go