From 18086b0be7663613461185029ddbeacc3435b59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E7=AB=9E=E5=AE=81?= Date: Fri, 22 Sep 2023 20:57:43 +0800 Subject: [PATCH] fix: eof for read --- copy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/copy.go b/copy.go index 8dab89b..eb716c4 100644 --- a/copy.go +++ b/copy.go @@ -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]