I\'m getting an error returned from an io.Copy call, to which I\'ve passed a socket (TCPConn) as the destination. It\'s expected that
error
io.Copy
TCPConn
As of go 1.13, you can use errors.Is instead of type assertions.
if errors.Is(err, syscall.EPIPE) { // broken pipe }