diff options
author | Martin Möhrmann <moehrmann@google.com> | 2019-05-22 14:27:47 +0200 |
---|---|---|
committer | Martin Möhrmann <moehrmann@google.com> | 2019-05-23 06:16:38 +0000 |
commit | 6f51082da77a1d4cafd5b7af0db69293943f4066 (patch) | |
tree | 4d03eef8263efac301f2a0f65540c516b7f426e5 /src/fmt | |
parent | 3e9d8e2e1bb94c3e302da8121f9cc018d86d1e71 (diff) | |
download | go-6f51082da77a1d4cafd5b7af0db69293943f4066.tar.gz go-6f51082da77a1d4cafd5b7af0db69293943f4066.zip |
fmt: always clear wrapErrs
Like panicking and erroring - wrapErrs should always be reset to
the default false. wrapErrs should only be true when set by Errorf.
Change-Id: I4d51cc2f0905109e232b0983dc5331bd34f138bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/178517
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/fmt')
-rw-r--r-- | src/fmt/print.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fmt/print.go b/src/fmt/print.go index 3253e8042e..595869140a 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -122,7 +122,7 @@ type pp struct { panicking bool // erroring is set when printing an error string to guard against calling handleMethods. erroring bool - // wrapErrors is set when the format string may contain a %w verb. + // wrapErrs is set when the format string may contain a %w verb. wrapErrs bool // wrappedErr records the target of the %w verb. wrappedErr error @@ -137,6 +137,7 @@ func newPrinter() *pp { p := ppFree.Get().(*pp) p.panicking = false p.erroring = false + p.wrapErrs = false p.fmt.init(&p.buf) return p } |