1
0
mirror of https://github.com/golang/go synced 2024-11-06 10:36:13 -07:00
go/src/bufio
Cuong Manh Le 48c0cef6dc bufio: return the underlying error in ReadFrom if not nil
If a previous Write returned an error, any subsequent Write or ReadFrom
must return that error before any operations.

However, only Write behaved correctly and this change fixes that problem
by making sure that ReadFrom firstly checks for the underlying error.

Fixes #35194

Change-Id: I31356a9e8bd945bc0168b2e3be470f3ae69d4813
Reviewed-on: https://go-review.googlesource.com/c/go/+/204000
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-31 17:21:56 +00:00
..
bufio_test.go bufio: return the underlying error in ReadFrom if not nil 2019-10-31 17:21:56 +00:00
bufio.go bufio: return the underlying error in ReadFrom if not nil 2019-10-31 17:21:56 +00:00
example_test.go bufio: fix ExampleScanner_Bytes comment, add error check 2019-06-25 00:29:24 +00:00
export_test.go
scan_test.go
scan.go