forked from mirror/afero
Don't hide errors while reading from ZIP files
This commit is contained in:
parent
9b520d0821
commit
344ad9d197
|
@ -33,9 +33,10 @@ func (f *File) fillBuffer(offset int64) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
buf := make([]byte, int(offset)-len(f.buf))
|
buf := make([]byte, int(offset)-len(f.buf))
|
||||||
n, _ := io.ReadFull(f.reader, buf)
|
if n, readErr := io.ReadFull(f.reader, buf); n > 0 {
|
||||||
if n > 0 {
|
|
||||||
f.buf = append(f.buf, buf[:n]...)
|
f.buf = append(f.buf, buf[:n]...)
|
||||||
|
} else if readErr != nil {
|
||||||
|
err = readErr
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue