]> Cypherpunks repositories - gostls13.git/commit
bufio: return the underlying error in ReadFrom if not nil
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 29 Oct 2019 06:27:00 +0000 (13:27 +0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 31 Oct 2019 17:21:56 +0000 (17:21 +0000)
commit48c0cef6dc9e7c95edaffb261250f99732686466
tree365e90154ad13fb27315439f35a71e0674d2eb5b
parent7de15e362b0bc4ba83c8ca4d7cadc319c99db65a
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>
src/bufio/bufio.go
src/bufio/bufio_test.go