From: Matt Joiner Date: Wed, 31 Aug 2016 08:02:45 +0000 (+1000) Subject: Uncomment the error handling in storage.boltDBPiece.ReadAt X-Git-Tag: v1.0.0~602 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e51cb07f6e3c9adde89b5068cb15919d541d62c0;p=btrtrc.git Uncomment the error handling in storage.boltDBPiece.ReadAt --- 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 }