An error occurred fetching the project authors.
- 02 Oct, 2014 1 commit
-
-
Rob Pike authored
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
-
- 01 Oct, 2014 1 commit
-
-
Rob Pike authored
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
-
- 08 Sep, 2014 1 commit
-
-
Russ Cox authored
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.
-
- 18 Aug, 2014 1 commit
-
-
Andrew Gerrand authored
type T byte func (T) String() string { return "X" } fmt.Sprintf("%s", []T{97, 98, 99, 100}) == "abcd" fmt.Sprintf("%x", []T{97, 98, 99, 100}) == "61626364" fmt.Sprintf("%v", []T{97, 98, 99, 100}) == "[X X X X]" This change makes the last case print correctly. Before, it would have been "[97 98 99 100]". Fixes #8360. LGTM=r R=r, dan.kortschak CC=golang-codereviews https://golang.org/cl/129330043
-
- 03 Apr, 2014 1 commit
-
-
Shenghou Ma authored
Fixes #7639. LGTM=rsc R=r, adg, rsc CC=golang-codereviews https://golang.org/cl/81240043
-
- 19 Mar, 2014 1 commit
-
-
Rob Pike authored
Rationale: It already is for scanning. It is accepted for complexes already, but doesn't work. It's analogous to %G and %E. C accepts it too, and we try to be roughly compatible. Fixes #7518. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/77580044
-
- 18 Dec, 2013 1 commit
-
-
Brad Fitzpatrick authored
Update #4720 R=golang-dev, iant CC=golang-dev https://golang.org/cl/43990043
-
- 23 Sep, 2013 1 commit
-
-
Rob Pike authored
In an indexed verb such as %[3]d, if the index is out of range, don't skip processing the rest of the verbs. The bug was that the bad index set a bit for the whole format instead of just the verb. Ok for 1.2 because this is a bug in a 1.2 feature. Fixes #6434 R=golang-dev, adg CC=golang-dev https://golang.org/cl/13632058
-
- 15 Sep, 2013 1 commit
-
-
Rob Pike authored
Just an oversight they were missing. Fixes #6387 R=golang-dev, dominik.honnef, rsc CC=golang-dev https://golang.org/cl/13715043
-
- 28 Aug, 2013 1 commit
-
-
Robin Eklind authored
R=golang-dev, remyoudompheng CC=golang-dev https://golang.org/cl/12795052
-
- 02 Aug, 2013 1 commit
-
-
Rob Pike authored
Includes deleting some unused items. R=golang-dev, adg CC=golang-dev https://golang.org/cl/12305043
-
- 31 Jul, 2013 2 commits
-
-
Robert Daniel Kortschak authored
Fixes #5730. R=dsymonds, r, kamil.kisiel CC=golang-dev https://golang.org/cl/11998044
-
Rob Pike authored
Fixes #5730. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12141043
-
- 23 Jul, 2013 1 commit
-
-
Rob Pike authored
Phrases like "returns whether or not the image is opaque" could be describing what the function does (it always returns, regardless of the opacity) or what it returns (a boolean indicating the opacity). Even when the "or not" is missing, the phrasing is bizarre. Go with "reports whether", which is still clunky but at least makes it clear we're talking about the return value. These were edited by hand. A few were cleaned up in other ways. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/11699043
-
- 20 Jun, 2013 1 commit
-
-
Rob Pike authored
These are not erroneous, just poor or confusing. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/10448043
-
- 29 May, 2013 1 commit
-
-
Rob Pike authored
The old code put the index before the period in the precision; it should be after so it's always before the star, as documented. A little trickier to do in one pass but compensated for by more tests and catching a couple of other error cases. R=rsc CC=golang-dev https://golang.org/cl/9751044
-
- 24 May, 2013 1 commit
-
-
Rob Pike authored
This text is added to doc.go: Explicit argument indexes: In Printf, Sprintf, and Fprintf, the default behavior is for each formatting verb to format successive arguments passed in the call. However, the notation [n] immediately before the verb indicates that the nth one-indexed argument is to be formatted instead. The same notation before a '*' for a width or precision selects the argument index holding the value. After processing a bracketed expression [n], arguments n+1, n+2, etc. will be processed unless otherwise directed. For example, fmt.Sprintf("%[2]d %[1]d\n", 11, 22) will yield "22, 11", while fmt.Sprintf("%[3]*[2].*[1]f", 12.0, 2, 6), equivalent to fmt.Sprintf("%6.2f", 12.0), will yield " 12.00". Because an explicit index affects subsequent verbs, this notation can be used to print the same values multiple times by resetting the index for the first argument to be repeated: fmt.Sprintf("%d %d %#[1]x %#x", 16, 17) will yield "16 17 0x10 0x11". The notation chosen differs from that in C, but I believe it's easier to read and to remember (we're indexing the arguments), and compatibility with C's printf was never a strong goal anyway. While we're here, change the word "field" to "arg" or "argument" in the code; it was being misused and was confusing. R=rsc, bradfitz, rogpeppe, minux.ma, peter.armitage CC=golang-dev https://golang.org/cl/9680043
-
- 29 Apr, 2013 1 commit
-
-
Rob Pike authored
Fixes #5311 R=golang-dev, bradfitz, iant CC=golang-dev https://golang.org/cl/8961050
-
- 10 Apr, 2013 1 commit
-
-
Rob Pike authored
The String method is called whenever the printing operation wants a string, not just for %s and %v. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/8638043
-
- 20 Feb, 2013 1 commit
-
-
Robert Dinu authored
Apply width when using Printf with nil values. Fixes #4772. R=r, adg CC=golang-dev https://golang.org/cl/7314114
-
- 31 Jan, 2013 1 commit
-
-
Robert Daniel Kortschak authored
Fixes #4685. R=golang-dev, adg, remyoudompheng, rsc CC=golang-dev https://golang.org/cl/7205047
-
- 22 Jan, 2013 1 commit
-
-
Robin Eklind authored
R=minux.ma, dave, rsc CC=golang-dev https://golang.org/cl/7064055
-
- 25 Dec, 2012 1 commit
-
-
Oling Cat authored
R=golang-dev, iant CC=golang-dev, minux.ma https://golang.org/cl/6998055
-
- 30 Oct, 2012 1 commit
-
-
Robert Griesemer authored
Remove trailing whitespace in comments. No other changes. R=r CC=golang-dev https://golang.org/cl/6815053
-
- 26 Sep, 2012 1 commit
-
-
Rob Pike authored
Silly and small but easy to be consistent. To make it worthwhile, I eliminated an allocation when using %x on a byte slice. Fixes #4149. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6574046
-
- 17 Aug, 2012 1 commit
-
-
Rob Pike authored
Before, pointers always appeared as 0x1234ABCD. This CL keeps that as the default for %p and %v, but lets explicit numeric verbs override the default. Fixes #3936. R=golang-dev, iant CC=golang-dev https://golang.org/cl/6441152
-
- 25 Jun, 2012 1 commit
-
-
Rob Pike authored
Fixes #3752. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6331062
-
- 06 Jun, 2012 1 commit
-
-
Russ Cox authored
The reordering speedup in CL 6245068 changed the semantics of %#v by delaying the clearing of some flags. Restore the old semantics and add a test. Fixes #3706. R=golang-dev, r CC=golang-dev https://golang.org/cl/6302048
-
- 29 May, 2012 1 commit
-
-
Rob Pike authored
The check for Stringer etc. can only fire if the test is not a builtin, so avoid the expensive check if we know there's no chance. Also put in a fast path for pad, which saves a more modest amount. benchmark old ns/op new ns/op delta BenchmarkSprintfEmpty 148 152 +2.70% BenchmarkSprintfString 585 497 -15.04% BenchmarkSprintfInt 441 396 -10.20% BenchmarkSprintfIntInt 718 603 -16.02% BenchmarkSprintfPrefixedInt 676 621 -8.14% BenchmarkSprintfFloat 1003 953 -4.99% BenchmarkManyArgs 2945 2312 -21.49% BenchmarkScanInts 1704152 1734441 +1.78% BenchmarkScanRecursiveInt 1837397 1828920 -0.46% R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6245068
-
- 07 Mar, 2012 1 commit
-
-
Russ Cox authored
$ go list -f '{{.ImportPath}} {{.Deps}}' fmt log fmt [errors io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8 unsafe] log [errors fmt io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8 unsafe] R=bradfitz, rogpeppe, r, r, rsc CC=golang-dev https://golang.org/cl/5753055
-
- 08 Feb, 2012 1 commit
-
-
Russ Cox authored
Fixes #2851. R=golang-dev, r CC=golang-dev https://golang.org/cl/5644048
-
- 15 Dec, 2011 2 commits
-
-
Rob Pike authored
%g down to two mallocs from four. Also a mild speedup. fmt_test.BenchmarkSprintfFloat 3016 2703 -10.38% Fixes #2557. R=rsc CC=golang-dev https://golang.org/cl/5491054
-
Rob Pike authored
Fixes #2555. R=golang-dev, dsymonds, r CC=golang-dev https://golang.org/cl/5486076
-
- 06 Dec, 2011 1 commit
-
-
Rob Pike authored
This is a slight change to fmt's semantics, but means that if you use %d to print an integer with a Stringable value, it will print as an integer. This came up because Time.Month() couldn't cleanly print as an integer rather than a name. Using %d on Stringables is silly anyway, so there should be no effect outside the fmt tests. As a mild bonus, certain recursive failures of String methods will also be avoided this way. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5453053
-
- 23 Nov, 2011 1 commit
-
-
Rémy Oudompheng authored
Also add array values to printing test suite. Fixes #2468. R=golang-dev, r CC=golang-dev, remy https://golang.org/cl/5436053
-
- 14 Nov, 2011 1 commit
-
-
Russ Cox authored
Also update Scanf tests to cope with DeepEqual distinguishing empty vs nil slice. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5375091
-
- 08 Nov, 2011 1 commit
-
-
Rob Pike authored
R=rsc CC=golang-dev https://golang.org/cl/5358041
-
- 02 Nov, 2011 2 commits
-
-
Russ Cox authored
R=adg CC=golang-dev https://golang.org/cl/5328062
-
Russ Cox authored
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
-
- 28 Oct, 2011 1 commit
-
-
Russ Cox authored
Handling os.Error is no different than handling fmt.Stringer here, so the code is redundant now, but it will be necessary once error goes in. Adding it now will make gofix fix it. R=r CC=golang-dev https://golang.org/cl/5331045
-