0
0

+ keep 'getWithSnapshot' consistent with levigo implementation

- this change keeps the method behavior consistent with the
     levigo/leveldb implementation.

   - the leveldb store_test.go and goleveldb store_test.go are now
     identical.
This commit is contained in:
indraniel 2015-03-21 06:04:16 -05:00
parent caa19e6c36
commit 5e55fa2866
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,9 @@ func (ldbs *Store) get(key []byte) ([]byte, error) {
func (ldbs *Store) getWithSnapshot(key []byte, snapshot *leveldb.Snapshot) ([]byte, error) {
options := defaultReadOptions()
b, err := snapshot.Get(key, options)
if err == leveldb.ErrNotFound {
return nil, nil
}
return b, err
}

View File

@ -204,7 +204,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
// but that the isolated reader does not
val, err = reader.Get([]byte("b"))
if err != nil && err.Error() != "leveldb: not found" {
if err != nil {
t.Error(err)
}
if val != nil {