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
|
|
that pad() still counts bytes, but it's currently only used for
1 byte runes.
Fixes issue 612.
R=r
CC=golang-dev
http://codereview.appspot.com/217064
Committer: Rob Pike <r@golang.org>
|
|
R=gri
CC=golang-dev
http://codereview.appspot.com/223059
|
|
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports
R=r
CC=golang-dev
http://codereview.appspot.com/224062
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/224051
|
|
Try to avoid infinite recursion if String fails due to
printing a bad type.
Add test for String method with named basic types.
R=r
CC=golang-dev
http://codereview.appspot.com/207102
|
|
add some tests for erroneous formats.
R=rsc
CC=golang-dev
http://codereview.appspot.com/201058
|
|
R=r, cw
CC=golang-dev
http://codereview.appspot.com/198085
|
|
R=rsc
CC=golang-dev
http://codereview.appspot.com/197043
|
|
- use an interface {Get()}
- implement Get for maps, slices
- for slices, retrieves the address of the end of the array, which will give the
same value for every slice of the same array.
R=rsc
CC=golang-dev
http://codereview.appspot.com/179129
|
|
(Also fix case sensitivity in test for PTR inside fmt_test.go)
Fixes issue 441.
R=rsc, iant
CC=golang-dev
http://codereview.appspot.com/180112
|
|
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
2nd set of files.
R=rsc
CC=golang-dev
http://codereview.appspot.com/179067
|
|
a couple of cleanups.
don't keep big buffers in the free list.
R=rsc
CC=golang-dev
http://codereview.appspot.com/166078
|