Skip to content

Commit

Permalink
Fix ineffassign warnings. (#1055)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored Sep 30, 2019
1 parent e7d0a7b commit 50ddf21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion key_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestMismatch(t *testing.T) {
_, err = rand.Read(encryptionKey)
require.NoError(t, err)
opt.EncryptionKey = encryptionKey
kr, err = OpenKeyRegistry(opt)
_, err = OpenKeyRegistry(opt)
require.Error(t, err)
require.EqualError(t, err, ErrEncryptionKeyMismatch.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func TestReadOnlyOpenWithPartialAppendToValueLog(t *testing.T) {

opts.ReadOnly = true
// Badger should fail a read-only open with values to replay
kv, err = Open(opts)
_, err = Open(opts)
require.Error(t, err)
require.Regexp(t, "Database was not properly closed, cannot open read-only|Read-only mode is not supported on Windows", err.Error())
}
Expand Down
3 changes: 3 additions & 0 deletions y/y_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ func TestPagebufferReader3(t *testing.T) {
// Read EOF.
n, err = reader.Read(readBuf)
require.Equal(t, err, io.EOF, "should return EOF")
require.Equal(t, n, 0)

// Read EOF again.
n, err = reader.Read(readBuf)
require.Equal(t, err, io.EOF, "should return EOF")
require.Equal(t, n, 0)
}

// Test when read buffer is larger than PageBuffer.
Expand All @@ -250,4 +252,5 @@ func TestPagebufferReader4(t *testing.T) {
// Read EOF.
n, err = reader.Read(readBuf)
require.Equal(t, err, io.EOF, "should return EOF")
require.Equal(t, n, 0)
}

0 comments on commit 50ddf21

Please sign in to comment.