From: Russ Cox Date: Mon, 12 Nov 2018 16:36:12 +0000 (-0500) Subject: bufio: put notes about len(p) together X-Git-Tag: go1.12beta1~377 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=de50ea3cd848f187766825402f8d6c8109536443;p=gostls13.git bufio: put notes about len(p) together CL 145577 added the part about io.ReadFull to read len(p) but it should be next to the existing sentence about not reading len(p) bytes. Change-Id: Idfa037c59a3085d44d5da6129188473db0e96d23 Reviewed-on: https://go-review.googlesource.com/c/148903 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Alan Donovan --- diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go index e498dfea1e..46df619228 100644 --- a/src/bufio/bufio.go +++ b/src/bufio/bufio.go @@ -186,9 +186,8 @@ func (b *Reader) Discard(n int) (discarded int, err error) { // It returns the number of bytes read into p. // The bytes are taken from at most one Read on the underlying Reader, // hence n may be less than len(p). -// At EOF, the count will be zero and err will be io.EOF. -// // To read exactly len(p) bytes, use io.ReadFull(b, p). +// At EOF, the count will be zero and err will be io.EOF. func (b *Reader) Read(p []byte) (n int, err error) { n = len(p) if n == 0 {