From e51cb07f6e3c9adde89b5068cb15919d541d62c0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 31 Aug 2016 18:02:45 +1000 Subject: [PATCH] Uncomment the error handling in storage.boltDBPiece.ReadAt --- storage/boltdb.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/storage/boltdb.go b/storage/boltdb.go index 4a6928a5..a198f488 100644 --- a/storage/boltdb.go +++ b/storage/boltdb.go @@ -2,6 +2,7 @@ package storage import ( "encoding/binary" + "io" "path/filepath" "github.com/boltdb/bolt" @@ -100,13 +101,13 @@ func (me *boltDBPiece) ReadAt(b []byte, off int64) (n int, err error) { } return nil }) - // if n == 0 && err == nil { - // if off < me.p.Length() { - // err = io.ErrUnexpectedEOF - // } else { - // err = io.EOF - // } - // } + if n == 0 && err == nil { + if off < me.p.Length() { + err = io.ErrUnexpectedEOF + } else { + err = io.EOF + } + } // // log.Println(n, err) return } -- 2.50.0