+ 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:
parent
caa19e6c36
commit
5e55fa2866
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user