]> Cypherpunks repositories - gostls13.git/commit
io: fix Pipe regression with differing error types
authorJoe Tsai <joetsai@digital-static.net>
Thu, 2 Nov 2017 22:03:28 +0000 (15:03 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Thu, 2 Nov 2017 23:05:53 +0000 (23:05 +0000)
commitaf37332d160e096fe5bedc551f318c7b76d4e57a
treec458a554c045775eedd8b1ad25504b69f9e58db6
parent41d860cf0e7cb63003d55839b59949752b7fdecc
io: fix Pipe regression with differing error types

Usage of atomic.Value has a subtle requirement that the
value be of the same concrete type. In prior usage, the intention
was to consistently store a value of the error type.
Since error is an interface, the underlying concrete can differ.

Fix this by creating a type-safe abstraction over atomic.Value
that wraps errors in a struct{error} type to ensure consistent types.

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