summaryrefslogtreecommitdiff
path: root/src/fmt
Commit message (Collapse)AuthorAgeFilesLines
* fmt: fix one-letter typo in doc.goRob Pike2014-10-291-1/+1
| | | | | | | | | Stupid mistake in previous CL. TBR=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/166880043
* fmt: fix documentation for %g and %GRob Pike2014-10-281-2/+2
| | | | | | | | | | | It now echoes what strconv.FormatFloat says. Fixes issue 9012. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://codereview.appspot.com/169730043
* fmt: print &map like &slice and &structRob Pike2014-10-033-3/+52
| | | | | | | | | | | | | | It was inconsistent. Also test these better. Also document the default format for types. This wasn't written down. Fixes issue 8470. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/154870043
* fmt: part 2 of the great flag rebuild: make %+v work in formattersRob Pike2014-10-033-154/+127
| | | | | | | | | | | | | | 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 issue 8835. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/154820043
* fmt: make the %#v verb a special flagRob Pike2014-10-023-84/+196
| | | | | | | | | | | | | | | | | | | | | 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 issue 8835 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/146650043
* fmt: fix internal unknownType functionRob Pike2014-10-011-3/+3
| | | | | | | | | | | | | | 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 issue 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://codereview.appspot.com/151970043
* fmt: document and fix the handling of precision for strings and byte slicesRob Pike2014-09-243-8/+25
| | | | | | | | | | | | | 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 issue 8151. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/144540044
* fmt: document that self-recursive data structures can be fatalRob Pike2014-09-221-0/+4
| | | | | | | | | Fixes issue 8241. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/144420043
* fmt: make printing of ints 25-35% fasterRob Pike2014-09-222-4/+47
| | | | | | | | | | | | | | | | | | | | | | | Inspired by a remark by Leonard Holz, use constants for division BenchmarkSprintfEmpty 130 132 +1.54% BenchmarkSprintfString 438 437 -0.23% BenchmarkSprintfInt 417 414 -0.72% BenchmarkSprintfIntInt 663 691 +4.22% BenchmarkSprintfPrefixedInt 791 774 -2.15% BenchmarkSprintfFloat 701 686 -2.14% BenchmarkManyArgs 2584 2469 -4.45% BenchmarkFprintInt 488 357 -26.84% BenchmarkFprintIntNoAlloc 402 265 -34.08% BenchmarkScanInts 1244346 1267574 +1.87% BenchmarkScanRecursiveInt 1748741 1724138 -1.41% Update issue 3463 LGTM=josharian, rsc R=golang-codereviews, josharian, rsc CC=golang-codereviews https://codereview.appspot.com/144250043
* fmt: fix allocation testsJosh Bleecher Snyder2014-09-181-2/+2
| | | | | | | | | | | Converting an integer to an interface{} allocates as of CL 130240043. Fixes issue 8617. LGTM=r R=r CC=golang-codereviews, khr https://codereview.appspot.com/141700043
* fmt: fix allocation testRob Pike2014-09-091-4/+7
| | | | | | | | | | With new interface allocation rules, the old counts were wrong and so was the commentary. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/142760044
* build: move package sources from src/pkg to srcRuss Cox2014-09-088-0/+5380
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.