fmt: fix %d and other non-string verbs on errors
When formatting an error with a non-string formatting verb such as %d, use the default formatting behavior rather than treating this as a bad verb. For example, this should print 42, not %!d(main.E=42): var E int func (E) Error() string { return "error" } fmt.Printf("%d", E(42)) Fixes #30472 Change-Id: I62fd309c8ee9839a69052b0ec7f1808449dcee8e Reviewed-on: https://go-review.googlesource.com/c/164557Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Showing
Please register or sign in to comment