fix: eof for read

This commit is contained in:
崔竞宁
2023-09-22 20:57:43 +08:00
parent 290748251e
commit 18086b0be7

View File

@@ -209,7 +209,9 @@ func (c *Copyer) streamCopy(ctx context.Context, dsts []chan []byte, src io.Read
n, err := io.ReadFull(src, buf)
if err != nil {
return fmt.Errorf("slice mmap fail, %w", err)
if !errors.Is(err, io.ErrUnexpectedEOF) && !errors.Is(err, io.EOF) {
return fmt.Errorf("slice mmap fail, %w", err)
}
}
buf = buf[:n]