aboutsummaryrefslogtreecommitdiff
path: root/src/bufio
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2018-11-12 11:36:12 -0500
committerRuss Cox <rsc@golang.org>2018-11-13 03:25:22 +0000
commitde50ea3cd848f187766825402f8d6c8109536443 (patch)
treed83d4c7f4da25ef6de09d9ab9d3f681fbdc9e0ee /src/bufio
parentee55f0856a3f1fed5d8c15af54c40e4799c2d32f (diff)
downloadgo-de50ea3cd848f187766825402f8d6c8109536443.tar.gz
go-de50ea3cd848f187766825402f8d6c8109536443.zip
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 <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/bufio')
-rw-r--r--src/bufio/bufio.go3
1 files changed, 1 insertions, 2 deletions
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 {