Skip to content

Commit

Permalink
chore(*): enable nilnil linter (#401)
Browse files Browse the repository at this point in the history
enable `nilnil` linter

Signed-off-by: Soren Yang <[email protected]>
  • Loading branch information
lsytj0413 authored Dec 9, 2023
1 parent c7f7fd3 commit 1948e4e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ linters:
# - gosec
- nakedret
- nilerr
# - nilnil
- nilnil
# - noctx
- nolintlint
- prealloc
Expand Down
2 changes: 1 addition & 1 deletion server/kv/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func checkExpectedVersionId(batch WriteBatch, key string, expectedVersionId *int
if errors.Is(err, ErrKeyNotFound) {
if expectedVersionId == nil || *expectedVersionId == -1 {
// OK, we were checking that the key was not there, and it's indeed not there
return nil, nil
return nil, nil //nolint:nilnil
} else {
return nil, ErrBadVersionId
}
Expand Down
2 changes: 1 addition & 1 deletion server/quorum_ack_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (q *quorumAckTracker) WaitForCommitOffset(ctx context.Context, offset int64
return f()
}

return nil, nil
return nil, nil //nolint:nilnil
}

func (q *quorumAckTracker) Close() error {
Expand Down
2 changes: 1 addition & 1 deletion server/quorum_ack_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestQuorumAckTracker_WaitForCommitOffset(t *testing.T) {

go func() {
_, err := at.WaitForCommitOffset(context.Background(), 2, func() (*proto.WriteResponse, error) {
return nil, nil
return nil, nil //nolint:nilnil
})
ch <- err
}()
Expand Down

0 comments on commit 1948e4e

Please sign in to comment.