Skip to content

Commit

Permalink
Fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Sep 12, 2024
1 parent 1b76b24 commit eff4f48
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,21 @@ func runBadgerTest(t *testing.T, opts *Options, test func(t *testing.T, db *DB))
func TestReverseIterator(t *testing.T) {
runBadgerTest(t, nil, func(t *testing.T, db *DB) {
key := make([]byte, 6)
db.Update(func(txn *Txn) error {
err := db.Update(func(txn *Txn) error {
binary.BigEndian.PutUint16(key, 5)
binary.BigEndian.PutUint32(key[2:], 1)
txn.Set(key, []byte("value1"))
err1 := txn.Set(key, []byte("value1"))
require.NoError(t, err1)

binary.BigEndian.PutUint32(key[2:], 2)
txn.Set(key, []byte("value2"))
err1 = txn.Set(key, []byte("value2"))
require.NoError(t, err1)
return nil
})

db.View(func(txn *Txn) error {
require.NoError(t, err)

err = db.View(func(txn *Txn) error {
searchBuffer := make([]byte, 3)
binary.BigEndian.PutUint16(searchBuffer, 5)
searchBuffer[2] = 0xFF
Expand All @@ -193,6 +197,8 @@ func TestReverseIterator(t *testing.T) {
require.Equal(t, it.Item().Key(), key)
return nil
})

require.NoError(t, err)
})
}

Expand Down

0 comments on commit eff4f48

Please sign in to comment.