The %#v verb is special: it says all values below need to print as %#v.
However, for some situations the # flag has other meanings and this
causes some issues, particularly in how Formatters work. Since %#v
dominates all formatting, translate it into actual state of the formatter
and decouple it from the # flag itself within the calculations (although
it must be restored when methods are doing the work.)
The result is cleaner code and correct handling of # for Formatters.
TODO: Apply the same thinking to the + flag in a followup CL.
Also, the wasString return value in handleMethods is always false,
so eliminate it.
Update #8835
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/146650043
This thing should never be called, but before
151960044 it was being called, incorrectly.
This is now just a precaution but let's pretend it
Fixes#8843
even though that was fixed by 151960044.
The test case was already there and ran, another mystery.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/151970043
Previous behavior was undocumented and inconsistent. Now it is documented
and consistent and measures the input size, since that makes more sense
when talking about %q and %x. For %s the change has no effect.
Fixes#8151.
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144540044
Converting an integer to an interface{} allocates as of CL 130240043.
Fixes#8617.
LGTM=r
R=r
CC=golang-codereviews, khr
https://golang.org/cl/141700043
With new interface allocation rules, the old counts were wrong and
so was the commentary.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/142760044