objcache: Return io.ReaderAt to avoid Seeking and Reading. (#3735)

This commit is contained in:
Harshavardhana
2017-02-11 17:17:58 -08:00
committed by GitHub
parent 440866d26c
commit 22909c849e
3 changed files with 14 additions and 11 deletions

View File

@@ -20,7 +20,6 @@ package objcache
import (
"bytes"
"io"
"io/ioutil"
"testing"
"time"
)
@@ -173,7 +172,8 @@ func TestObjCache(t *testing.T) {
t.Errorf("Test case 4 expected to pass, failed instead %s", err)
}
// Reads everything stored for key "test".
cbytes, err := ioutil.ReadAll(r)
cbytes := make([]byte, 5)
_, err = r.ReadAt(cbytes, 0)
if err != nil {
t.Errorf("Test case 4 expected to pass, failed instead %s", err)
}