diff --git a/.golangci.yml b/.golangci.yml index 600552cc..2895cca6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 @@ -68,7 +68,6 @@ linters-settings: # # https://github.com/mvdan/gofumpt/issues/137 gofumpt: - lang-version: "1.21" extra-rules: true gosec: @@ -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"] diff --git a/pkg/kgo/consumer.go b/pkg/kgo/consumer.go index 76ba397b..10e0fb44 100644 --- a/pkg/kgo/consumer.go +++ b/pkg/kgo/consumer.go @@ -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 }) diff --git a/pkg/kgo/consumer_direct_test.go b/pkg/kgo/consumer_direct_test.go index f02b0d69..b63f5343 100644 --- a/pkg/kgo/consumer_direct_test.go +++ b/pkg/kgo/consumer_direct_test.go @@ -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) } @@ -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) } diff --git a/pkg/kgo/topics_and_partitions.go b/pkg/kgo/topics_and_partitions.go index 083b90f6..3c25284f 100644 --- a/pkg/kgo/topics_and_partitions.go +++ b/pkg/kgo/topics_and_partitions.go @@ -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) @@ -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, ) {