]> Cypherpunks repositories - gostls13.git/commit
net: return io.ErrClosedPipe when possible from net.Pipe
authorJoe Tsai <joetsai@digital-static.net>
Mon, 4 Dec 2017 19:16:51 +0000 (11:16 -0800)
committerJoe Tsai <thebrokentoaster@gmail.com>
Tue, 5 Dec 2017 18:44:28 +0000 (18:44 +0000)
commit8f2a9267c814538485dd3459910bc8e6de2ef2bb
tree94811c388ecfaf4f7d4c7c36b4f2395a4fb0b8bf
parent49fec9b488177f2f212c5f6746203c519ae02264
net: return io.ErrClosedPipe when possible from net.Pipe

The previous implementation of net.Pipe was just a thin wrapper around
io.Pipe and did not wrap any of the io.Pipe errors as net.Errors.
As a result of Hyrum's law, users have come to depend on the fact that
net.Pipe returns io.ErrClosedPipe when the pipe is closed.
Thus, we preserve this behavior to avoid regressing such use cases.

Change-Id: I06b387877b944c1c08527601f58983872b7557b4
Reviewed-on: https://go-review.googlesource.com/81777
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/pipe.go
src/net/pipe_test.go