aboutsummaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-12-23 15:27:46 -0800
committerIan Lance Taylor <iant@golang.org>2019-12-27 06:01:32 +0000
commit4f757179543e06daec58df6af5884516f8bceb86 (patch)
tree8ad4ec248d982843d8879551e8ec42f57d6de035 /src/io
parent2d6f8cc2cdd5993eb8dc80655735a38ef067af6e (diff)
downloadgo-4f757179543e06daec58df6af5884516f8bceb86.tar.gz
go-4f757179543e06daec58df6af5884516f8bceb86.zip
io: show ErrUnexpectedEOF in ExampleReadAtLeast
Fixes #36245 Change-Id: I10ce50b0cc28b15f4e7be85b8f12cf9d0e4fac96 Reviewed-on: https://go-review.googlesource.com/c/go/+/212404 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/io')
-rw-r--r--src/io/example_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/io/example_test.go b/src/io/example_test.go
index edcd0086f5..2eaab678c9 100644
--- a/src/io/example_test.go
+++ b/src/io/example_test.go
@@ -59,7 +59,7 @@ func ExampleCopyN() {
func ExampleReadAtLeast() {
r := strings.NewReader("some io.Reader stream to be read\n")
- buf := make([]byte, 33)
+ buf := make([]byte, 14)
if _, err := io.ReadAtLeast(r, buf, 4); err != nil {
log.Fatal(err)
}
@@ -78,10 +78,9 @@ func ExampleReadAtLeast() {
}
// Output:
- // some io.Reader stream to be read
- //
+ // some io.Reader
// error: short buffer
- // error: EOF
+ // error: unexpected EOF
}
func ExampleReadFull() {