aboutsummaryrefslogtreecommitdiff
path: root/src/fmt
diff options
context:
space:
mode:
authorMartin Möhrmann <moehrmann@google.com>2019-05-22 14:27:47 +0200
committerMartin Möhrmann <moehrmann@google.com>2019-05-23 06:16:38 +0000
commit6f51082da77a1d4cafd5b7af0db69293943f4066 (patch)
tree4d03eef8263efac301f2a0f65540c516b7f426e5 /src/fmt
parent3e9d8e2e1bb94c3e302da8121f9cc018d86d1e71 (diff)
downloadgo-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.go3
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
}