diff --git a/stream.go b/stream.go index 5da942c..5515ee5 100644 --- a/stream.go +++ b/stream.go @@ -109,6 +109,7 @@ func (s *Stream) Write(b []byte) (n int, err error) { deadline = timer.C } + // check if stream has closed select { case <-s.die: return 0, errors.WithStack(io.ErrClosedPipe)