Skip to content

Commit 66128ef

Browse files
committed
kv: remove some tautological conditionals
Epic: none Release note: None
1 parent cad9544 commit 66128ef

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

pkg/kv/client_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -874,10 +874,8 @@ func TestTxn_ReverseScan(t *testing.T) {
874874
t.Errorf("expected empty, got %v", rows)
875875
}
876876
return err
877-
}); err != nil {
878-
if err == nil {
879-
t.Errorf("expected a truncation error, got %s", err)
880-
}
877+
}); err == nil || !strings.Contains(err.Error(), "must be greater than start") {
878+
t.Errorf("expected a truncation error, got %s", err)
881879
}
882880

883881
// Try reverse scan with non-existent key.

pkg/kv/txn_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ func newTestTxnFactory(
119119
}
120120
if ba.Txn != nil && br.Txn == nil {
121121
br.Txn = ba.Txn.Clone()
122-
if pErr == nil {
123-
br.Txn.Status = status
124-
}
122+
br.Txn.Status = status
125123
// Update the MockTxnSender's proto.
126124
*txn = *br.Txn
127125
}

0 commit comments

Comments
 (0)