mirror of
https://github.com/redis/go-redis.git
synced 2025-06-06 17:40:59 +03:00
migrate golangci-lint config to v2 format (#3354)
* migrate golangci-lint config to v2 format * chore: skip CI on migration [skip ci] * Bump golangci version * Address several golangci-lint/staticcheck warnings * change staticchecks settings
This commit is contained in:
parent
cb2cfb000d
commit
09dc3510a2
4
.github/workflows/golangci-lint.yml
vendored
4
.github/workflows/golangci-lint.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6.5.2
|
||||
uses: golangci/golangci-lint-action@v7.0.0
|
||||
with:
|
||||
verify: false # disable verifying the configuration since golangci is currently introducing breaking changes in the configuration
|
||||
verify: true
|
||||
|
||||
|
@ -1,3 +1,34 @@
|
||||
version: "2"
|
||||
run:
|
||||
timeout: 5m
|
||||
tests: false
|
||||
linters:
|
||||
settings:
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
# Incorrect or missing package comment.
|
||||
# https://staticcheck.dev/docs/checks/#ST1000
|
||||
- -ST1000
|
||||
# Omit embedded fields from selector expression.
|
||||
# https://staticcheck.dev/docs/checks/#QF1008
|
||||
- -QF1008
|
||||
- -ST1003
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
@ -1412,7 +1412,8 @@ func (cmd *MapStringSliceInterfaceCmd) readReply(rd *proto.Reader) (err error) {
|
||||
|
||||
cmd.val = make(map[string][]interface{})
|
||||
|
||||
if readType == proto.RespMap {
|
||||
switch readType {
|
||||
case proto.RespMap:
|
||||
n, err := rd.ReadMapLen()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -1435,7 +1436,7 @@ func (cmd *MapStringSliceInterfaceCmd) readReply(rd *proto.Reader) (err error) {
|
||||
cmd.val[k][j] = value
|
||||
}
|
||||
}
|
||||
} else if readType == proto.RespArray {
|
||||
case proto.RespArray:
|
||||
// RESP2 response
|
||||
n, err := rd.ReadArrayLen()
|
||||
if err != nil {
|
||||
|
@ -19,6 +19,6 @@ require (
|
||||
)
|
||||
|
||||
retract (
|
||||
v9.5.3 // This version was accidentally released.
|
||||
v9.7.2 // This version was accidentally released.
|
||||
v9.5.3 // This version was accidentally released.
|
||||
)
|
||||
|
@ -16,6 +16,6 @@ require (
|
||||
)
|
||||
|
||||
retract (
|
||||
v9.5.3 // This version was accidentally released.
|
||||
v9.7.2 // This version was accidentally released.
|
||||
v9.5.3 // This version was accidentally released.
|
||||
)
|
||||
|
@ -24,6 +24,6 @@ require (
|
||||
)
|
||||
|
||||
retract (
|
||||
v9.5.3 // This version was accidentally released.
|
||||
v9.7.2 // This version was accidentally released.
|
||||
v9.5.3 // This version was accidentally released.
|
||||
)
|
||||
|
@ -23,6 +23,6 @@ require (
|
||||
)
|
||||
|
||||
retract (
|
||||
v9.5.3 // This version was accidentally released.
|
||||
v9.7.2 // This version was accidentally released.
|
||||
v9.5.3 // This version was accidentally released.
|
||||
)
|
||||
|
@ -214,9 +214,10 @@ func (opt *Options) init() {
|
||||
opt.ConnMaxIdleTime = 30 * time.Minute
|
||||
}
|
||||
|
||||
if opt.MaxRetries == -1 {
|
||||
switch opt.MaxRetries {
|
||||
case -1:
|
||||
opt.MaxRetries = 0
|
||||
} else if opt.MaxRetries == 0 {
|
||||
case 0:
|
||||
opt.MaxRetries = 3
|
||||
}
|
||||
switch opt.MinRetryBackoff {
|
||||
|
@ -111,9 +111,10 @@ type ClusterOptions struct {
|
||||
}
|
||||
|
||||
func (opt *ClusterOptions) init() {
|
||||
if opt.MaxRedirects == -1 {
|
||||
switch opt.MaxRedirects {
|
||||
case -1:
|
||||
opt.MaxRedirects = 0
|
||||
} else if opt.MaxRedirects == 0 {
|
||||
case 0:
|
||||
opt.MaxRedirects = 3
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user