1
0
mirror of https://github.com/golang/go synced 2024-10-05 09:21:22 -06:00
Commit Graph

5 Commits

Author SHA1 Message Date
Rob Pike
a0c5adc35c fmt: print &map like &slice and &struct
It was inconsistent.
Also test these better.
Also document the default format for types.
This wasn't written down.

Fixes #8470.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/154870043
2014-10-03 20:27:08 -07:00
Rob Pike
a22424567c fmt: part 2 of the great flag rebuild: make %+v work in formatters
Apply a similar transformation to %+v that we did to %#v, making it
a top-level setting separate from the + flag itself. This fixes the
appearance of flags in Formatters and cleans up the code too,
probably making it a little faster.

Fixes #8835.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/154820043
2014-10-03 13:23:35 -07:00
Rob Pike
7c8e057ad3 fmt: make the %#v verb a special flag
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
2014-10-02 14:16:58 -07:00
Rob Pike
9f4084278f fmt: fix internal unknownType function
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
2014-10-01 21:35:12 +00:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
2014-09-08 00:08:51 -04:00