Skip to content

Commit

Permalink
all: fix lints, bump lint lang
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed May 9, 2024
1 parent 0d335d8 commit bf1d48a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We may as well allow multiple golangci-lint invocations at once.
run:
allow-parallel-runners: true
go: "1.21"
go: "1.22"

# golangci-lint by default ignores some staticcheck and vet raised issues that
# are actually important to catch. The following ensures that we do not ignore
Expand Down Expand Up @@ -68,7 +68,6 @@ linters-settings:
#
# https://github.com/mvdan/gofumpt/issues/137
gofumpt:
lang-version: "1.21"
extra-rules: true

gosec:
Expand Down Expand Up @@ -163,5 +162,4 @@ linters-settings:
# contexts for beneficial reasons, and we disable the SSLv3 deprecation
# warning because this is solely for a debug log.
staticcheck:
go: "1.21"
checks: ["all", "-SA1012", "-SA1019"]
2 changes: 1 addition & 1 deletion pkg/kgo/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ func (c *consumer) assignPartitions(assignments map[string]map[int32]Offset, how
case assignPurgeMatching:
// This is slightly different than invalidate in that
// we invalidate whole topics.
loadOffsets.keepFilter(func(t string, p int32) bool {
loadOffsets.keepFilter(func(t string, _ int32) bool {
_, ok := assignments[t]
return !ok // assignments are topics to purge -- do NOT keep the topic if it is being purged
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/kgo/consumer_direct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func TestPauseIssue489(t *testing.T) {
r := StringRecord("v")
r.Partition = int32(which % 3)
which++
cl.Produce(ctx, r, func(r *Record, err error) {
cl.Produce(ctx, r, func(_ *Record, err error) {
if err == context.Canceled {
exit.Store(true)
}
Expand Down Expand Up @@ -372,7 +372,7 @@ func TestPauseIssueOct2023(t *testing.T) {
r := StringRecord("v")
r.Topic = ts[which%len(ts)]
which++
cl.Produce(ctx, r, func(r *Record, err error) {
cl.Produce(ctx, r, func(_ *Record, err error) {
if err == context.Canceled {
exit.Store(true)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kgo/topics_and_partitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ type topicPartitionData struct {
// has changed. This moves record production from one sink to the other; this
// must be done such that records produced during migration follow those
// already buffered.
func (old *topicPartition) migrateProductionTo(new *topicPartition) {
func (old *topicPartition) migrateProductionTo(new *topicPartition) { //nolint:revive // old/new naming makes this clearer
// First, remove our record buffer from the old sink.
old.records.sink.removeRecBuf(old.records)

Expand Down Expand Up @@ -572,7 +572,7 @@ func (old *topicPartition) migrateProductionTo(new *topicPartition) {
// This is a little bit different from above, in that we do this logic only
// after stopping a consumer session. With the consumer session stopped, we
// have fewer concurrency issues to worry about.
func (old *topicPartition) migrateCursorTo(
func (old *topicPartition) migrateCursorTo( //nolint:revive // old/new naming makes this clearer
new *topicPartition,
css *consumerSessionStopper,
) {
Expand Down

0 comments on commit bf1d48a

Please sign in to comment.