diff --git a/ioutils/bytespipe.go b/ioutils/bytespipe.go index eca129b..72a04f3 100644 --- a/ioutils/bytespipe.go +++ b/ioutils/bytespipe.go @@ -133,8 +133,9 @@ func (bp *BytesPipe) Read(p []byte) (n int, err error) { } bp.wait.Wait() if bp.bufLen == 0 && bp.closeErr != nil { + err := bp.closeErr bp.mu.Unlock() - return 0, bp.closeErr + return 0, err } }