1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:04:42 -07:00
go/src/io
Jordi Martin f45eb9ff3c io: add error check on pipe close functions to avoid error overwriting
The current implementation allows multiple calls `Close` and `CloseWithError` in every side of the pipe, as a result, the original error can be overwritten.

This CL fixes this behavior adding an error existence check on `atomicError` type
and keeping the first error still available.

Fixes #24283

Change-Id: Iefe8f758aeb775309424365f8177511062514150
GitHub-Last-Rev: b559540d7a
GitHub-Pull-Request: golang/go#33239
Reviewed-on: https://go-review.googlesource.com/c/go/+/187197
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-28 18:35:24 +00:00
..
ioutil
example_test.go
io_test.go
io.go io: export StringWriter 2018-10-03 20:13:35 +00:00
multi_test.go io: align style of test comments in multi_test.go 2019-02-26 23:01:20 +00:00
multi.go io: export StringWriter 2018-10-03 20:13:35 +00:00
pipe_test.go io: add error check on pipe close functions to avoid error overwriting 2019-08-28 18:35:24 +00:00
pipe.go io: add error check on pipe close functions to avoid error overwriting 2019-08-28 18:35:24 +00:00