Reader previously had cached an error from the underlying reader
and would return it on every subsequent call to Read. The Reader
will now return the error only once, and subsequent calls will result
in a new Read call to the underlying Reader.
Fixes#1934.
R=bradfitz, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/4528133
This is a core API change.
1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
gob/decode.go
rpc/client.go
os/error.go
io/io.go
bufio/bufio.go
http/request.go
websocket/client.go
as well as:
src/cmd/gofix/testdata/*.go.in (reverted)
test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)
Compiles and runs all tests.
R=r, rsc, gri
CC=golang-dev
https://golang.org/cl/4607052
It matches encoding/line exactly and the tests are copied from there.
If we land this, then encoding/line will get marked as deprecated then
deleted in time.
R=rsc, rog, peterGo
CC=golang-dev
https://golang.org/cl/4389046
Write never writes less than the buffer size and WriteString takes advantage
of the copy built-in to improve write efficiency.
R=rsc, ality, rog
CC=golang-dev
https://golang.org/cl/4344060
Dependency on bufio crept in during last CL; this breaks the cycle.
Also add a missing '-' to the documentation.
R=rsc
CC=golang-dev
https://golang.org/cl/4274061
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository. I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.
R=rsc
CC=golang-dev
https://golang.org/cl/3427043
After a fill(), there is nothing to back up. Make sure UnreadRune
recognizes the situation.
Fixes#1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).
R=rsc
CC=golang-dev
https://golang.org/cl/2498041
On error, ReadSlice is defined to return the available data
and advance past that data, but it was not behaving that
way for err == ErrBufferFull, making it harder for callers to
handle well.
R=r
CC=golang-dev
https://golang.org/cl/1480041
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.
stop on error in doc/progs/run
R=r
CC=golang-dev
https://golang.org/cl/850041
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
1st set of files.
R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes#115.
R=rsc, dsymonds1
https://golang.org/cl/157067
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
delete strings.Buffer
add a test for a bug not caught before (mustn't install zero-length blocks)
R=rsc
DELTA=987 (289 added, 587 deleted, 111 changed)
OCL=34850
CL=34850
make strings.Buffer handle strings and bytes with comparable efficiency.
if ok, next step will be to move this code to bytes.Buffer and terminate
strings.Buffer's short happy life.
R=rsc
DELTA=292 (212 added, 0 deleted, 80 changed)
OCL=34837
CL=34849