From: Martin Möhrmann Date: Wed, 22 May 2019 12:27:47 +0000 (+0200) Subject: fmt: always clear wrapErrs X-Git-Tag: go1.13beta1~219 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6f51082da77a1d4cafd5b7af0db69293943f4066;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Damien Neil --- 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 }