go/src/pkg/io
Russ Cox 662ff54212 io: guarantee err == nil for full reads in ReadFull and ReadAtLeast
This is a backwards compatible API change that fixes broken code.

In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or len(buf), non-nil.
Most code expects only the former, so do that and document the guarantee.

Code that was correct before is still correct.
Code that was incorrect before, by assuming the guarantee, is now correct too.

The same applies to ReadAtLeast.

Fixes #4544.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7235074
2013-01-31 13:46:12 -08:00
..
ioutil io/ioutil: fix Discard data race 2012-12-28 09:33:22 -08:00
io.go io: guarantee err == nil for full reads in ReadFull and ReadAtLeast 2013-01-31 13:46:12 -08:00
io_test.go io: guarantee err == nil for full reads in ReadFull and ReadAtLeast 2013-01-31 13:46:12 -08:00
multi.go io: use error, add EOF, avoid os 2011-11-01 21:48:52 -04:00
multi_test.go Add a []byte argument to hash.Hash to allow an allocation to be saved. 2011-12-01 12:35:37 -05:00
pipe.go all: more typos 2012-03-02 11:15:45 -08:00
pipe_test.go various: a grab-bag of time.Duration cleanups. 2011-12-13 10:42:56 +11:00