1
0
mirror of https://github.com/golang/go synced 2024-11-17 04:44:46 -07:00

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>
This commit is contained in:
Ian Lance Taylor 2019-12-23 15:27:46 -08:00
parent 2d6f8cc2cd
commit 4f75717954

View File

@ -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() {