properly report io.EOF

This commit is contained in:
Chris Lu
2020-08-18 08:18:54 -07:00
parent 0ca45a5cbc
commit 85001cbec7
2 changed files with 5 additions and 5 deletions

View File

@@ -114,7 +114,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) {
n += delta
}
if offset+int64(n) >= c.fileSize {
if err == nil && offset+int64(len(p)) > c.fileSize {
err = io.EOF
}
// fmt.Printf("~~~ filled %d, err: %v\n\n", n, err)