From 344ad9d197b9a029919060b3a66b8a191d9a69a6 Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Mon, 30 Mar 2020 15:28:04 +0200 Subject: [PATCH] Don't hide errors while reading from ZIP files --- zipfs/file.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zipfs/file.go b/zipfs/file.go index a81ea06..94f9ddc 100644 --- a/zipfs/file.go +++ b/zipfs/file.go @@ -33,9 +33,10 @@ func (f *File) fillBuffer(offset int64) (err error) { return } buf := make([]byte, int(offset)-len(f.buf)) - n, _ := io.ReadFull(f.reader, buf) - if n > 0 { + if n, readErr := io.ReadFull(f.reader, buf); n > 0 { f.buf = append(f.buf, buf[:n]...) + } else if readErr != nil { + err = readErr } return }