diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 9961c69c7..4ddaf8ecf 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -15,7 +15,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0 with: - version: v1.49.0 + version: v1.53.3 args: --config tools/.golangci.yaml - name: protoc uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0 diff --git a/contrib/raftexample/raft.go b/contrib/raftexample/raft.go index 971141ae3..14f1aca80 100644 --- a/contrib/raftexample/raft.go +++ b/contrib/raftexample/raft.go @@ -515,7 +515,7 @@ func (rc *raftNode) serveRaft() { func (rc *raftNode) Process(ctx context.Context, m raftpb.Message) error { return rc.node.Step(ctx, m) } -func (rc *raftNode) IsIDRemoved(id uint64) bool { return false } +func (rc *raftNode) IsIDRemoved(_ uint64) bool { return false } func (rc *raftNode) ReportUnreachable(id uint64) { rc.node.ReportUnreachable(id) } func (rc *raftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus) { rc.node.ReportSnapshot(id, status) diff --git a/contrib/raftexample/raftexample_test.go b/contrib/raftexample/raftexample_test.go index 6a8e52746..784f66801 100644 --- a/contrib/raftexample/raftexample_test.go +++ b/contrib/raftexample/raftexample_test.go @@ -78,7 +78,7 @@ func newCluster(n int) *cluster { func (clus *cluster) Close() (err error) { for i := range clus.peers { go func(i int) { - for range clus.commitC[i] { + for range clus.commitC[i] { //revive:disable-line:empty-block // drain pending commits } }(i) @@ -125,7 +125,7 @@ func TestProposeOnCommit(t *testing.T) { } } donec <- struct{}{} - for range cC { + for range cC { //revive:disable-line:empty-block // acknowledge the commits from other nodes so // raft continues to make progress } diff --git a/tools/benchmark/cmd/lease.go b/tools/benchmark/cmd/lease.go index 2ade5897d..5b273c032 100644 --- a/tools/benchmark/cmd/lease.go +++ b/tools/benchmark/cmd/lease.go @@ -42,7 +42,7 @@ func init() { leaseKeepaliveCmd.Flags().IntVar(&leaseKeepaliveTotal, "total", 10000, "Total number of lease keepalive requests") } -func leaseKeepaliveFunc(cmd *cobra.Command, args []string) { +func leaseKeepaliveFunc(_ *cobra.Command, _ []string) { requests := make(chan struct{}) clients := mustCreateClients(totalClients, totalConns) diff --git a/tools/benchmark/cmd/mvcc-put.go b/tools/benchmark/cmd/mvcc-put.go index 11ca074f0..c175dbfb1 100644 --- a/tools/benchmark/cmd/mvcc-put.go +++ b/tools/benchmark/cmd/mvcc-put.go @@ -70,7 +70,7 @@ func createBytesSlice(bytesN, sliceN int) [][]byte { return rs } -func mvccPutFunc(cmd *cobra.Command, args []string) { +func mvccPutFunc(_ *cobra.Command, _ []string) { if cpuProfPath != "" { f, err := os.Create(cpuProfPath) if err != nil { diff --git a/tools/benchmark/cmd/mvcc.go b/tools/benchmark/cmd/mvcc.go index 1d51c5237..baf2bf1a1 100644 --- a/tools/benchmark/cmd/mvcc.go +++ b/tools/benchmark/cmd/mvcc.go @@ -59,6 +59,6 @@ func init() { mvccCmd.PersistentFlags().IntVar(&batchLimit, "batch-limit", 10000, "A limit of batched transaction") } -func mvccPreRun(cmd *cobra.Command, args []string) { +func mvccPreRun(_ *cobra.Command, _ []string) { initMVCC() } diff --git a/tools/benchmark/cmd/put.go b/tools/benchmark/cmd/put.go index 7208fd352..5e3943ff2 100644 --- a/tools/benchmark/cmd/put.go +++ b/tools/benchmark/cmd/put.go @@ -71,7 +71,7 @@ func init() { putCmd.Flags().BoolVar(&checkHashkv, "check-hashkv", false, "'true' to check hashkv") } -func putFunc(cmd *cobra.Command, args []string) { +func putFunc(cmd *cobra.Command, _ []string) { if keySpaceSize <= 0 { fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) os.Exit(1) diff --git a/tools/benchmark/cmd/stm.go b/tools/benchmark/cmd/stm.go index e5c1ad5e7..eb3a5ee40 100644 --- a/tools/benchmark/cmd/stm.go +++ b/tools/benchmark/cmd/stm.go @@ -69,7 +69,7 @@ func init() { stmCmd.Flags().IntVar(&stmRate, "rate", 0, "Maximum STM transactions per second (0 is no limit)") } -func stmFunc(cmd *cobra.Command, args []string) { +func stmFunc(cmd *cobra.Command, _ []string) { if stmKeyCount <= 0 { fmt.Fprintf(os.Stderr, "expected positive --keys, got (%v)", stmKeyCount) os.Exit(1) diff --git a/tools/benchmark/cmd/txn_mixed.go b/tools/benchmark/cmd/txn_mixed.go index c5265e81d..d921285d9 100644 --- a/tools/benchmark/cmd/txn_mixed.go +++ b/tools/benchmark/cmd/txn_mixed.go @@ -69,7 +69,7 @@ type request struct { op v3.Op } -func mixedTxnFunc(cmd *cobra.Command, args []string) { +func mixedTxnFunc(cmd *cobra.Command, _ []string) { if keySpaceSize <= 0 { fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) os.Exit(1) diff --git a/tools/benchmark/cmd/txn_put.go b/tools/benchmark/cmd/txn_put.go index bea02f7ac..12990c6cb 100644 --- a/tools/benchmark/cmd/txn_put.go +++ b/tools/benchmark/cmd/txn_put.go @@ -55,7 +55,7 @@ func init() { txnPutCmd.Flags().IntVar(&keySpaceSize, "key-space-size", 1, "Maximum possible keys") } -func txnPutFunc(cmd *cobra.Command, args []string) { +func txnPutFunc(_ *cobra.Command, _ []string) { if keySpaceSize <= 0 { fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) os.Exit(1) diff --git a/tools/benchmark/cmd/watch.go b/tools/benchmark/cmd/watch.go index 110b372db..3d687a0b5 100644 --- a/tools/benchmark/cmd/watch.go +++ b/tools/benchmark/cmd/watch.go @@ -88,7 +88,7 @@ func init() { watchCmd.Flags().BoolVar(&watchSeqKeys, "sequential-keys", false, "Use sequential keys") } -func watchFunc(cmd *cobra.Command, args []string) { +func watchFunc(_ *cobra.Command, _ []string) { if watchKeySpaceSize <= 0 { fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", watchKeySpaceSize) os.Exit(1) diff --git a/tools/benchmark/cmd/watch_get.go b/tools/benchmark/cmd/watch_get.go index c70091b9c..0397964ae 100644 --- a/tools/benchmark/cmd/watch_get.go +++ b/tools/benchmark/cmd/watch_get.go @@ -49,7 +49,7 @@ func init() { watchGetCmd.Flags().IntVar(&watchEvents, "events", 8, "Number of events per watcher") } -func watchGetFunc(cmd *cobra.Command, args []string) { +func watchGetFunc(_ *cobra.Command, _ []string) { clients := mustCreateClients(totalClients, totalConns) getClient := mustCreateClients(1, 1) diff --git a/tools/benchmark/cmd/watch_latency.go b/tools/benchmark/cmd/watch_latency.go index 31ceb3b32..b51cb0752 100644 --- a/tools/benchmark/cmd/watch_latency.go +++ b/tools/benchmark/cmd/watch_latency.go @@ -54,7 +54,7 @@ func init() { watchLatencyCmd.Flags().IntVar(&watchLValueSize, "val-size", 32, "Value size of watch response") } -func watchLatencyFunc(cmd *cobra.Command, args []string) { +func watchLatencyFunc(_ *cobra.Command, _ []string) { key := string(mustRandBytes(watchLKeySize)) value := string(mustRandBytes(watchLValueSize)) diff --git a/tools/etcd-dump-db/backend.go b/tools/etcd-dump-db/backend.go index 50619d95d..5c9df5e42 100644 --- a/tools/etcd-dump-db/backend.go +++ b/tools/etcd-dump-db/backend.go @@ -113,7 +113,7 @@ func authDecoder(k, v []byte) { } } -func authRolesDecoder(k, v []byte) { +func authRolesDecoder(_, v []byte) { role := &authpb.Role{} err := role.Unmarshal(v) if err != nil { @@ -122,7 +122,7 @@ func authRolesDecoder(k, v []byte) { fmt.Printf("role=%q, keyPermission=%v\n", string(role.Name), role.KeyPermission) } -func authUsersDecoder(k, v []byte) { +func authUsersDecoder(_, v []byte) { user := &authpb.User{} err := user.Unmarshal(v) if err != nil { diff --git a/tools/etcd-dump-db/main.go b/tools/etcd-dump-db/main.go index f82d91f76..95e6c4392 100644 --- a/tools/etcd-dump-db/main.go +++ b/tools/etcd-dump-db/main.go @@ -68,7 +68,7 @@ func main() { } } -func listBucketCommandFunc(cmd *cobra.Command, args []string) { +func listBucketCommandFunc(_ *cobra.Command, args []string) { if len(args) < 1 { log.Fatalf("Must provide at least 1 argument (got %v)", args) } @@ -89,7 +89,7 @@ func listBucketCommandFunc(cmd *cobra.Command, args []string) { } } -func iterateBucketCommandFunc(cmd *cobra.Command, args []string) { +func iterateBucketCommandFunc(_ *cobra.Command, args []string) { if len(args) != 2 { log.Fatalf("Must provide 2 arguments (got %v)", args) } @@ -107,7 +107,7 @@ func iterateBucketCommandFunc(cmd *cobra.Command, args []string) { } } -func getHashCommandFunc(cmd *cobra.Command, args []string) { +func getHashCommandFunc(_ *cobra.Command, args []string) { if len(args) < 1 { log.Fatalf("Must provide at least 1 argument (got %v)", args) }