Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nice side effect: slices now obey their format verb. example:
fmt.Printf("%q\n", []string{"a"})
R=rsc
CC=golang-dev
http://codereview.appspot.com/1729045
|
|
Fixes issue 876.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1675048
|
|
gob: substitute slice for map
R=r
CC=golang-dev
http://codereview.appspot.com/1699045
|
|
update other code to match.
R=r
CC=golang-dev
http://codereview.appspot.com/1680044
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/1693043
Committer: Rob Pike <r@golang.org>
|
|
While we're at it, clean up and test the code to guarantee we see every byte when
the text is erroneous UTF-8.
Fixes issue 866.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1712042
|
|
Fix a bug that caused it to ignore field widths.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1704041
|
|
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.
One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:
1) width is honored for String() items
2) %x works for String() items
3) implementations of String that merely recur will recur forever
Regarding point 3, example from the updated documentation:
type X int
func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
func (x X) String() string { return Sprintf("%d", int(x)) }
R=rsc
CC=golang-dev
http://codereview.appspot.com/1613045
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/1518042
|
|
Also fix an interface bug: white-space-delimited doesn't work well for cases like "%d, %d" on "23, 23")
R=rsc
CC=golang-dev
http://codereview.appspot.com/1502041
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/1486041
|
|
- provide convenience functions for scanning strings
- enable Scanf etc.
- update doc comments
R=rsc
CC=golang-dev
http://codereview.appspot.com/1451044
|
|
- implement scanning for all renamed types
(compiler bug stops complex from being renamable,
so it can't be tested but the code is there)
- %q %x for strings
- error handling now done with panic/recover
R=rsc
CC=golang-dev
http://codereview.appspot.com/1458041
|
|
- implement scanning for all renamed types
(compiler bug stops complex from being renamable,
so it can't be tested but the code is there)
- %q %x for strings
- error handling now done with panic/recover
R=rsc
CC=golang-dev
http://codereview.appspot.com/1458041
|
|
Fixes issue 821.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1434041
|
|
use the same function.
simplifies the code significantly.
Still TODO:
- proper format handling
- strings
R=rsc
CC=golang-dev
http://codereview.appspot.com/1432041
|
|
- reimplement integer scanning to handle renamed basic integer types
- start implementation of Fscanf and Scanf; not yet ready for general use.
This intermediate CL is a useful checkpoint. A similar change needs to be
done for float and complex, but it seemed worth getting the approach
reviewed before making those changes.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1418041
|
|
read from standard input. Add description of scanning to
the package comment.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1390041
|
|
R=gri
CC=golang-dev
http://codereview.appspot.com/1326042
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/1315042
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/1315042
|
|
R=gri
CC=golang-dev
http://codereview.appspot.com/1316042
|
|
Still to do:
- composite types
- user-defined scanners
- format-driven scanning
The package comment will be updated when more of the functionality is in place.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1252045
|
|
apply gofmt to src, misc
Fixes issue 752.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1240044
Committer: Robert Griesemer <gri@golang.org>
|
|
R=rsc, r
CC=golang-dev
http://codereview.appspot.com/1195041
Committer: Rob Pike <r@golang.org>
|
|
R=r
CC=golang-dev, rsc
http://codereview.appspot.com/1014043
Committer: Rob Pike <r@golang.org>
|
|
fmt.Printf("%b", int8(-1)) prints 64 ones instead of 8.
This happens only for signed integers (int8, in16 and int32). I guess it's because of the way the conversion between integer types works. From go spec: "Conversions between integer types. If the value is a signed quantity, it is sign extended to implicit infinite precision ....". And there are several conversions to int64 and uint64 in the fmt package. This pathch solves only half of the problem. On a 32 bit system, an fmt.Printf("%b", int(-1)) should still print 64 ones.
R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/891049
Committer: Rob Pike <r@golang.org>
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/357043
|
|
add tests.
R=rsc, ken2, ken3
CC=golang-dev
http://codereview.appspot.com/261041
|
|
R=r
CC=golang-dev
http://codereview.appspot.com/254043
|
|
8g and 5g have stubs to ignore complex
R=rsc
CC=golang-dev
http://codereview.appspot.com/257042
|