Update golangci-lint from 1.49.0 to 1.53.3

Signed-off-by: iuriatan <iuriatan@gmail.com>
This commit is contained in:
iuriatan 2023-07-13 17:44:53 -03:00
parent 882edb3d63
commit b798aae9c5
15 changed files with 19 additions and 19 deletions

View File

@ -15,7 +15,7 @@ jobs:
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0 uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
with: with:
version: v1.49.0 version: v1.53.3
args: --config tools/.golangci.yaml args: --config tools/.golangci.yaml
- name: protoc - name: protoc
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0 uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0

View File

@ -515,7 +515,7 @@ func (rc *raftNode) serveRaft() {
func (rc *raftNode) Process(ctx context.Context, m raftpb.Message) error { func (rc *raftNode) Process(ctx context.Context, m raftpb.Message) error {
return rc.node.Step(ctx, m) 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) ReportUnreachable(id uint64) { rc.node.ReportUnreachable(id) }
func (rc *raftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus) { func (rc *raftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus) {
rc.node.ReportSnapshot(id, status) rc.node.ReportSnapshot(id, status)

View File

@ -78,7 +78,7 @@ func newCluster(n int) *cluster {
func (clus *cluster) Close() (err error) { func (clus *cluster) Close() (err error) {
for i := range clus.peers { for i := range clus.peers {
go func(i int) { go func(i int) {
for range clus.commitC[i] { for range clus.commitC[i] { //revive:disable-line:empty-block
// drain pending commits // drain pending commits
} }
}(i) }(i)
@ -125,7 +125,7 @@ func TestProposeOnCommit(t *testing.T) {
} }
} }
donec <- struct{}{} donec <- struct{}{}
for range cC { for range cC { //revive:disable-line:empty-block
// acknowledge the commits from other nodes so // acknowledge the commits from other nodes so
// raft continues to make progress // raft continues to make progress
} }

View File

@ -42,7 +42,7 @@ func init() {
leaseKeepaliveCmd.Flags().IntVar(&leaseKeepaliveTotal, "total", 10000, "Total number of lease keepalive requests") 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{}) requests := make(chan struct{})
clients := mustCreateClients(totalClients, totalConns) clients := mustCreateClients(totalClients, totalConns)

View File

@ -70,7 +70,7 @@ func createBytesSlice(bytesN, sliceN int) [][]byte {
return rs return rs
} }
func mvccPutFunc(cmd *cobra.Command, args []string) { func mvccPutFunc(_ *cobra.Command, _ []string) {
if cpuProfPath != "" { if cpuProfPath != "" {
f, err := os.Create(cpuProfPath) f, err := os.Create(cpuProfPath)
if err != nil { if err != nil {

View File

@ -59,6 +59,6 @@ func init() {
mvccCmd.PersistentFlags().IntVar(&batchLimit, "batch-limit", 10000, "A limit of batched transaction") 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() initMVCC()
} }

View File

@ -71,7 +71,7 @@ func init() {
putCmd.Flags().BoolVar(&checkHashkv, "check-hashkv", false, "'true' to check hashkv") 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 { if keySpaceSize <= 0 {
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
os.Exit(1) os.Exit(1)

View File

@ -69,7 +69,7 @@ func init() {
stmCmd.Flags().IntVar(&stmRate, "rate", 0, "Maximum STM transactions per second (0 is no limit)") 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 { if stmKeyCount <= 0 {
fmt.Fprintf(os.Stderr, "expected positive --keys, got (%v)", stmKeyCount) fmt.Fprintf(os.Stderr, "expected positive --keys, got (%v)", stmKeyCount)
os.Exit(1) os.Exit(1)

View File

@ -69,7 +69,7 @@ type request struct {
op v3.Op op v3.Op
} }
func mixedTxnFunc(cmd *cobra.Command, args []string) { func mixedTxnFunc(cmd *cobra.Command, _ []string) {
if keySpaceSize <= 0 { if keySpaceSize <= 0 {
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
os.Exit(1) os.Exit(1)

View File

@ -55,7 +55,7 @@ func init() {
txnPutCmd.Flags().IntVar(&keySpaceSize, "key-space-size", 1, "Maximum possible keys") 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 { if keySpaceSize <= 0 {
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize) fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
os.Exit(1) os.Exit(1)

View File

@ -88,7 +88,7 @@ func init() {
watchCmd.Flags().BoolVar(&watchSeqKeys, "sequential-keys", false, "Use sequential keys") 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 { if watchKeySpaceSize <= 0 {
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", watchKeySpaceSize) fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", watchKeySpaceSize)
os.Exit(1) os.Exit(1)

View File

@ -49,7 +49,7 @@ func init() {
watchGetCmd.Flags().IntVar(&watchEvents, "events", 8, "Number of events per watcher") 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) clients := mustCreateClients(totalClients, totalConns)
getClient := mustCreateClients(1, 1) getClient := mustCreateClients(1, 1)

View File

@ -54,7 +54,7 @@ func init() {
watchLatencyCmd.Flags().IntVar(&watchLValueSize, "val-size", 32, "Value size of watch response") 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)) key := string(mustRandBytes(watchLKeySize))
value := string(mustRandBytes(watchLValueSize)) value := string(mustRandBytes(watchLValueSize))

View File

@ -113,7 +113,7 @@ func authDecoder(k, v []byte) {
} }
} }
func authRolesDecoder(k, v []byte) { func authRolesDecoder(_, v []byte) {
role := &authpb.Role{} role := &authpb.Role{}
err := role.Unmarshal(v) err := role.Unmarshal(v)
if err != nil { if err != nil {
@ -122,7 +122,7 @@ func authRolesDecoder(k, v []byte) {
fmt.Printf("role=%q, keyPermission=%v\n", string(role.Name), role.KeyPermission) fmt.Printf("role=%q, keyPermission=%v\n", string(role.Name), role.KeyPermission)
} }
func authUsersDecoder(k, v []byte) { func authUsersDecoder(_, v []byte) {
user := &authpb.User{} user := &authpb.User{}
err := user.Unmarshal(v) err := user.Unmarshal(v)
if err != nil { if err != nil {

View File

@ -68,7 +68,7 @@ func main() {
} }
} }
func listBucketCommandFunc(cmd *cobra.Command, args []string) { func listBucketCommandFunc(_ *cobra.Command, args []string) {
if len(args) < 1 { if len(args) < 1 {
log.Fatalf("Must provide at least 1 argument (got %v)", args) 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 { if len(args) != 2 {
log.Fatalf("Must provide 2 arguments (got %v)", args) 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 { if len(args) < 1 {
log.Fatalf("Must provide at least 1 argument (got %v)", args) log.Fatalf("Must provide at least 1 argument (got %v)", args)
} }