diff --git a/.golangci.yml b/.golangci.yml index 912dab1e..2132eee9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,9 +7,15 @@ linters: disable: - funlen - gochecknoglobals + - gochecknoinits - gocognit - goconst - godox - gosec - maligned - wsl + - gomnd + - goerr113 + - exhaustive + - gofumpt + - nestif diff --git a/.travis.yml b/.travis.yml index 3521d852..ffc5fd7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,5 @@ env: go_import_path: github.com/go-redis/redis before_install: - - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- + -b $(go env GOPATH)/bin v1.28.3 diff --git a/cluster.go b/cluster.go index dac0d889..aeba3a5d 100644 --- a/cluster.go +++ b/cluster.go @@ -1655,21 +1655,6 @@ loop: return ss } -func remove(ss []string, es ...string) []string { - if len(es) == 0 { - return ss[:0] - } - for _, e := range es { - for i, s := range ss { - if s == e { - ss = append(ss[:i], ss[i+1:]...) - break - } - } - } - return ss -} - //------------------------------------------------------------------------------ type cmdsMap struct { diff --git a/command.go b/command.go index 622fdb44..81e0c4db 100644 --- a/command.go +++ b/command.go @@ -304,7 +304,7 @@ func (cmd *Cmd) readReply(rd *proto.Reader) error { return cmd.err } -// Implements proto.MultiBulkParse +// sliceParser implements proto.MultiBulkParse. func sliceParser(rd *proto.Reader, n int64) (interface{}, error) { vals := make([]interface{}, n) for i := 0; i < len(vals); i++ { @@ -1072,7 +1072,7 @@ func (cmd *XMessageSliceCmd) readReply(rd *proto.Reader) error { return nil } -// Implements proto.MultiBulkParse +// xMessageSliceParser implements proto.MultiBulkParse. func xMessageSliceParser(rd *proto.Reader, n int64) (interface{}, error) { msgs := make([]XMessage, n) for i := 0; i < len(msgs); i++ { @@ -1107,7 +1107,7 @@ func xMessageSliceParser(rd *proto.Reader, n int64) (interface{}, error) { return msgs, nil } -// Implements proto.MultiBulkParse +// stringInterfaceMapParser implements proto.MultiBulkParse. func stringInterfaceMapParser(rd *proto.Reader, n int64) (interface{}, error) { m := make(map[string]interface{}, n/2) for i := int64(0); i < n; i += 2 { diff --git a/commands.go b/commands.go index 0ef1b606..d32442a0 100644 --- a/commands.go +++ b/commands.go @@ -1315,14 +1315,14 @@ func (c cmdable) SIsMember(ctx context.Context, key string, member interface{}) return cmd } -// Redis `SMEMBERS key` command output as a slice +// Redis `SMEMBERS key` command output as a slice. func (c cmdable) SMembers(ctx context.Context, key string) *StringSliceCmd { cmd := NewStringSliceCmd(ctx, "smembers", key) _ = c(ctx, cmd) return cmd } -// Redis `SMEMBERS key` command output as a map +// Redis `SMEMBERS key` command output as a map. func (c cmdable) SMembersMap(ctx context.Context, key string) *StringStructMapCmd { cmd := NewStringStructMapCmd(ctx, "smembers", key) _ = c(ctx, cmd) @@ -2144,7 +2144,8 @@ func (c cmdable) ClientKill(ctx context.Context, ipPort string) *StatusCmd { } // ClientKillByFilter is new style syntax, while the ClientKill is old -// CLIENT KILL