Skip to content

Commit 0e23bea

Browse files
committed
run gofumpt with option -extra
1 parent 37fee1a commit 0e23bea

22 files changed

+76
-76
lines changed

bitmap_commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type BitMapCmdable interface {
1212
BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
1313
BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
1414
BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
15-
BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
15+
BitOpNot(ctx context.Context, destKey, key string) *IntCmd
1616
BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
1717
BitPosSpan(ctx context.Context, key string, bit int8, start, end int64, span string) *IntCmd
1818
BitField(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
@@ -92,7 +92,7 @@ func (c cmdable) BitOpXor(ctx context.Context, destKey string, keys ...string) *
9292
return c.bitOp(ctx, "xor", destKey, keys...)
9393
}
9494

95-
func (c cmdable) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd {
95+
func (c cmdable) BitOpNot(ctx context.Context, destKey, key string) *IntCmd {
9696
return c.bitOp(ctx, "not", destKey, key)
9797
}
9898

cluster_commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type ClusterCmdable interface {
1515
ClusterResetHard(ctx context.Context) *StatusCmd
1616
ClusterInfo(ctx context.Context) *StringCmd
1717
ClusterKeySlot(ctx context.Context, key string) *IntCmd
18-
ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
18+
ClusterGetKeysInSlot(ctx context.Context, slot, count int) *StringSliceCmd
1919
ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
2020
ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
2121
ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
@@ -101,7 +101,7 @@ func (c cmdable) ClusterKeySlot(ctx context.Context, key string) *IntCmd {
101101
return cmd
102102
}
103103

104-
func (c cmdable) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd {
104+
func (c cmdable) ClusterGetKeysInSlot(ctx context.Context, slot, count int) *StringSliceCmd {
105105
cmd := NewStringSliceCmd(ctx, "cluster", "getkeysinslot", slot, count)
106106
_ = c(ctx, cmd)
107107
return cmd

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ type XInfoConsumer struct {
19731973

19741974
var _ Cmder = (*XInfoConsumersCmd)(nil)
19751975

1976-
func NewXInfoConsumersCmd(ctx context.Context, stream string, group string) *XInfoConsumersCmd {
1976+
func NewXInfoConsumersCmd(ctx context.Context, stream, group string) *XInfoConsumersCmd {
19771977
return &XInfoConsumersCmd{
19781978
baseCmd: baseCmd{
19791979
ctx: ctx,

error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func isBadConn(err error, allowTimeout bool, addr string) bool {
111111
return true
112112
}
113113

114-
func isMovedError(err error) (moved bool, ask bool, addr string) {
114+
func isMovedError(err error) (moved, ask bool, addr string) {
115115
if !isRedisError(err) {
116116
return
117117
}

extra/rediscmd/rediscmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func appendArg(b []byte, v interface{}) []byte {
123123
}
124124
}
125125

126-
func appendUTF8String(dst []byte, src []byte) []byte {
126+
func appendUTF8String(dst, src []byte) []byte {
127127
if isSimple(src) {
128128
dst = append(dst, src...)
129129
return dst

extra/rediscmd/rediscmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestGinkgo(t *testing.T) {
1414

1515
var _ = Describe("AppendArg", func() {
1616
DescribeTable("...",
17-
func(src string, wanted string) {
17+
func(src, wanted string) {
1818
b := appendArg(nil, src)
1919
Expect(string(b)).To(Equal(wanted))
2020
},

gears_commands.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ type GearsCmdable interface {
1212
TFunctionDelete(ctx context.Context, libName string) *StatusCmd
1313
TFunctionList(ctx context.Context) *MapStringInterfaceSliceCmd
1414
TFunctionListArgs(ctx context.Context, options *TFunctionListOptions) *MapStringInterfaceSliceCmd
15-
TFCall(ctx context.Context, libName string, funcName string, numKeys int) *Cmd
16-
TFCallArgs(ctx context.Context, libName string, funcName string, numKeys int, options *TFCallOptions) *Cmd
17-
TFCallASYNC(ctx context.Context, libName string, funcName string, numKeys int) *Cmd
18-
TFCallASYNCArgs(ctx context.Context, libName string, funcName string, numKeys int, options *TFCallOptions) *Cmd
15+
TFCall(ctx context.Context, libName, funcName string, numKeys int) *Cmd
16+
TFCallArgs(ctx context.Context, libName, funcName string, numKeys int, options *TFCallOptions) *Cmd
17+
TFCallASYNC(ctx context.Context, libName, funcName string, numKeys int) *Cmd
18+
TFCallASYNCArgs(ctx context.Context, libName, funcName string, numKeys int, options *TFCallOptions) *Cmd
1919
}
2020

2121
type TFunctionLoadOptions struct {
@@ -98,15 +98,15 @@ func (c cmdable) TFunctionListArgs(ctx context.Context, options *TFunctionListOp
9898

9999
// TFCall - invoke a function.
100100
// For more information - https://redis.io/commands/tfcall/
101-
func (c cmdable) TFCall(ctx context.Context, libName string, funcName string, numKeys int) *Cmd {
101+
func (c cmdable) TFCall(ctx context.Context, libName, funcName string, numKeys int) *Cmd {
102102
lf := libName + "." + funcName
103103
args := []interface{}{"TFCALL", lf, numKeys}
104104
cmd := NewCmd(ctx, args...)
105105
_ = c(ctx, cmd)
106106
return cmd
107107
}
108108

109-
func (c cmdable) TFCallArgs(ctx context.Context, libName string, funcName string, numKeys int, options *TFCallOptions) *Cmd {
109+
func (c cmdable) TFCallArgs(ctx context.Context, libName, funcName string, numKeys int, options *TFCallOptions) *Cmd {
110110
lf := libName + "." + funcName
111111
args := []interface{}{"TFCALL", lf, numKeys}
112112
if options != nil {
@@ -124,15 +124,15 @@ func (c cmdable) TFCallArgs(ctx context.Context, libName string, funcName string
124124

125125
// TFCallASYNC - invoke an asynchronous JavaScript function (coroutine).
126126
// For more information - https://redis.io/commands/TFCallASYNC/
127-
func (c cmdable) TFCallASYNC(ctx context.Context, libName string, funcName string, numKeys int) *Cmd {
127+
func (c cmdable) TFCallASYNC(ctx context.Context, libName, funcName string, numKeys int) *Cmd {
128128
lf := fmt.Sprintf("%s.%s", libName, funcName)
129129
args := []interface{}{"TFCALLASYNC", lf, numKeys}
130130
cmd := NewCmd(ctx, args...)
131131
_ = c(ctx, cmd)
132132
return cmd
133133
}
134134

135-
func (c cmdable) TFCallASYNCArgs(ctx context.Context, libName string, funcName string, numKeys int, options *TFCallOptions) *Cmd {
135+
func (c cmdable) TFCallASYNCArgs(ctx context.Context, libName, funcName string, numKeys int, options *TFCallOptions) *Cmd {
136136
lf := fmt.Sprintf("%s.%s", libName, funcName)
137137
args := []interface{}{"TFCALLASYNC", lf, numKeys}
138138
if options != nil {

generic_commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type GenericCmdable interface {
4040
Touch(ctx context.Context, keys ...string) *IntCmd
4141
TTL(ctx context.Context, key string) *DurationCmd
4242
Type(ctx context.Context, key string) *StatusCmd
43-
Copy(ctx context.Context, sourceKey string, destKey string, db int, replace bool) *IntCmd
43+
Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
4444

4545
Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
4646
ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd

geo_commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type GeoCmdable interface {
1515
GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
1616
GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
1717
GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
18-
GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
18+
GeoDist(ctx context.Context, key, member1, member2, unit string) *FloatCmd
1919
GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
2020
}
2121

@@ -120,7 +120,7 @@ func (c cmdable) GeoSearchStore(ctx context.Context, key, store string, q *GeoSe
120120
}
121121

122122
func (c cmdable) GeoDist(
123-
ctx context.Context, key string, member1, member2, unit string,
123+
ctx context.Context, key, member1, member2, unit string,
124124
) *FloatCmd {
125125
if unit == "" {
126126
unit = "km"

internal/arg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func AppendArg(b []byte, v interface{}) []byte {
5252
}
5353
}
5454

55-
func appendUTF8String(dst []byte, src []byte) []byte {
55+
func appendUTF8String(dst, src []byte) []byte {
5656
dst = append(dst, src...)
5757
return dst
5858
}

internal/hscan/hscan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Struct(dst interface{}) (StructValue, error) {
7373

7474
// Scan scans the results from a key-value Redis map result set to a destination struct.
7575
// The Redis keys are matched to the struct's field with the `redis` tag.
76-
func Scan(dst interface{}, keys []interface{}, vals []interface{}) error {
76+
func Scan(dst interface{}, keys, vals []interface{}) error {
7777
if len(keys) != len(vals) {
7878
return errors.New("args should have the same number of keys and vals")
7979
}

internal/hscan/structmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ type StructValue struct {
8686
value reflect.Value
8787
}
8888

89-
func (s StructValue) Scan(key string, value string) error {
89+
func (s StructValue) Scan(key, value string) error {
9090
field, ok := s.spec.m[key]
9191
if !ok {
9292
return nil

internal/util/strconv.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ func Atoi(b []byte) (int, error) {
66
return strconv.Atoi(BytesToString(b))
77
}
88

9-
func ParseInt(b []byte, base int, bitSize int) (int64, error) {
9+
func ParseInt(b []byte, base, bitSize int) (int64, error) {
1010
return strconv.ParseInt(BytesToString(b), base, bitSize)
1111
}
1212

13-
func ParseUint(b []byte, base int, bitSize int) (uint64, error) {
13+
func ParseUint(b []byte, base, bitSize int) (uint64, error) {
1414
return strconv.ParseUint(BytesToString(b), base, bitSize)
1515
}
1616

iterator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var _ = Describe("ScanIterator", func() {
2121
return err
2222
}
2323

24-
extraSeed := func(n int, m int) error {
24+
extraSeed := func(n, m int) error {
2525
pipe := client.Pipeline()
2626
for i := 1; i <= m; i++ {
2727
pipe.Set(ctx, fmt.Sprintf("A%02d", i), "x", 0).Err()

json.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type JSONCmdable interface {
2626
JSONForget(ctx context.Context, key, path string) *IntCmd
2727
JSONGet(ctx context.Context, key string, paths ...string) *JSONCmd
2828
JSONGetWithArgs(ctx context.Context, key string, options *JSONGetArgs, paths ...string) *JSONCmd
29-
JSONMerge(ctx context.Context, key, path string, value string) *StatusCmd
29+
JSONMerge(ctx context.Context, key, path, value string) *StatusCmd
3030
JSONMSetArgs(ctx context.Context, docs []JSONSetArgs) *StatusCmd
3131
JSONMSet(ctx context.Context, params ...interface{}) *StatusCmd
3232
JSONMGet(ctx context.Context, path string, keys ...string) *JSONSliceCmd
@@ -450,7 +450,7 @@ func (c cmdable) JSONGetWithArgs(ctx context.Context, key string, options *JSONG
450450

451451
// JSONMerge merges a given JSON value into matching paths.
452452
// For more information, see https://redis.io/commands/json.merge
453-
func (c cmdable) JSONMerge(ctx context.Context, key, path string, value string) *StatusCmd {
453+
func (c cmdable) JSONMerge(ctx context.Context, key, path, value string) *StatusCmd {
454454
args := []interface{}{"JSON.MERGE", key, path, value}
455455
cmd := NewStatusCmd(ctx, args...)
456456
_ = c(ctx, cmd)

list_commands.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ type ListCmdable interface {
1919
LMPop(ctx context.Context, direction string, count int64, keys ...string) *KeyValuesCmd
2020
LPop(ctx context.Context, key string) *StringCmd
2121
LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
22-
LPos(ctx context.Context, key string, value string, args LPosArgs) *IntCmd
23-
LPosCount(ctx context.Context, key string, value string, count int64, args LPosArgs) *IntSliceCmd
22+
LPos(ctx context.Context, key, value string, args LPosArgs) *IntCmd
23+
LPosCount(ctx context.Context, key, value string, count int64, args LPosArgs) *IntSliceCmd
2424
LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
2525
LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
2626
LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
@@ -152,7 +152,7 @@ type LPosArgs struct {
152152
Rank, MaxLen int64
153153
}
154154

155-
func (c cmdable) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd {
155+
func (c cmdable) LPos(ctx context.Context, key, value string, a LPosArgs) *IntCmd {
156156
args := []interface{}{"lpos", key, value}
157157
if a.Rank != 0 {
158158
args = append(args, "rank", a.Rank)
@@ -166,7 +166,7 @@ func (c cmdable) LPos(ctx context.Context, key string, value string, a LPosArgs)
166166
return cmd
167167
}
168168

169-
func (c cmdable) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd {
169+
func (c cmdable) LPosCount(ctx context.Context, key, value string, count int64, a LPosArgs) *IntSliceCmd {
170170
args := []interface{}{"lpos", key, value, "count", count}
171171
if a.Rank != 0 {
172172
args = append(args, "rank", a.Rank)

options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ type Options struct {
5959
Password string
6060
// CredentialsProvider allows the username and password to be updated
6161
// before reconnecting. It should return the current username and password.
62-
CredentialsProvider func() (username string, password string)
62+
CredentialsProvider func() (username, password string)
6363

6464
// CredentialsProviderContext is an enhanced parameter of CredentialsProvider,
6565
// done to maintain API compatibility. In the future,
6666
// there might be a merge between CredentialsProviderContext and CredentialsProvider.
6767
// There will be a conflict between them; if CredentialsProviderContext exists, we will ignore CredentialsProvider.
68-
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
68+
CredentialsProviderContext func(ctx context.Context) (username, password string, err error)
6969

7070
// Database to be selected after connecting to the server.
7171
DB int

osscluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ type ClusterOptions struct {
6565
Protocol int
6666
Username string
6767
Password string
68-
CredentialsProvider func() (username string, password string)
69-
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
68+
CredentialsProvider func() (username, password string)
69+
CredentialsProviderContext func(ctx context.Context) (username, password string, err error)
7070

7171
MaxRetries int
7272
MinRetryBackoff time.Duration

probabilistic.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ type ProbabilisticCmdable interface {
3939
CFMExists(ctx context.Context, key string, elements ...interface{}) *BoolSliceCmd
4040
CFReserve(ctx context.Context, key string, capacity int64) *StatusCmd
4141
CFReserveWithArgs(ctx context.Context, key string, options *CFReserveOptions) *StatusCmd
42-
CFReserveExpansion(ctx context.Context, key string, capacity int64, expansion int64) *StatusCmd
43-
CFReserveBucketSize(ctx context.Context, key string, capacity int64, bucketsize int64) *StatusCmd
44-
CFReserveMaxIterations(ctx context.Context, key string, capacity int64, maxiterations int64) *StatusCmd
42+
CFReserveExpansion(ctx context.Context, key string, capacity, expansion int64) *StatusCmd
43+
CFReserveBucketSize(ctx context.Context, key string, capacity, bucketsize int64) *StatusCmd
44+
CFReserveMaxIterations(ctx context.Context, key string, capacity, maxiterations int64) *StatusCmd
4545
CFScanDump(ctx context.Context, key string, iterator int64) *ScanDumpCmd
4646
CFLoadChunk(ctx context.Context, key string, iterator int64, data interface{}) *StatusCmd
4747

@@ -61,7 +61,7 @@ type ProbabilisticCmdable interface {
6161
TopKListWithCount(ctx context.Context, key string) *MapStringIntCmd
6262
TopKQuery(ctx context.Context, key string, elements ...interface{}) *BoolSliceCmd
6363
TopKReserve(ctx context.Context, key string, k int64) *StatusCmd
64-
TopKReserveWithOptions(ctx context.Context, key string, k int64, width, depth int64, decay float64) *StatusCmd
64+
TopKReserveWithOptions(ctx context.Context, key string, k, width, depth int64, decay float64) *StatusCmd
6565

6666
TDigestAdd(ctx context.Context, key string, elements ...float64) *StatusCmd
6767
TDigestByRank(ctx context.Context, key string, rank ...uint64) *FloatSliceCmd
@@ -464,7 +464,7 @@ func (c cmdable) CFReserve(ctx context.Context, key string, capacity int64) *Sta
464464

465465
// CFReserveExpansion creates an empty Cuckoo filter with the specified capacity and expansion rate.
466466
// For more information - https://redis.io/commands/cf.reserve/
467-
func (c cmdable) CFReserveExpansion(ctx context.Context, key string, capacity int64, expansion int64) *StatusCmd {
467+
func (c cmdable) CFReserveExpansion(ctx context.Context, key string, capacity, expansion int64) *StatusCmd {
468468
args := []interface{}{"CF.RESERVE", key, capacity, "EXPANSION", expansion}
469469
cmd := NewStatusCmd(ctx, args...)
470470
_ = c(ctx, cmd)
@@ -473,7 +473,7 @@ func (c cmdable) CFReserveExpansion(ctx context.Context, key string, capacity in
473473

474474
// CFReserveBucketSize creates an empty Cuckoo filter with the specified capacity and bucket size.
475475
// For more information - https://redis.io/commands/cf.reserve/
476-
func (c cmdable) CFReserveBucketSize(ctx context.Context, key string, capacity int64, bucketsize int64) *StatusCmd {
476+
func (c cmdable) CFReserveBucketSize(ctx context.Context, key string, capacity, bucketsize int64) *StatusCmd {
477477
args := []interface{}{"CF.RESERVE", key, capacity, "BUCKETSIZE", bucketsize}
478478
cmd := NewStatusCmd(ctx, args...)
479479
_ = c(ctx, cmd)
@@ -482,7 +482,7 @@ func (c cmdable) CFReserveBucketSize(ctx context.Context, key string, capacity i
482482

483483
// CFReserveMaxIterations creates an empty Cuckoo filter with the specified capacity and maximum number of iterations.
484484
// For more information - https://redis.io/commands/cf.reserve/
485-
func (c cmdable) CFReserveMaxIterations(ctx context.Context, key string, capacity int64, maxiterations int64) *StatusCmd {
485+
func (c cmdable) CFReserveMaxIterations(ctx context.Context, key string, capacity, maxiterations int64) *StatusCmd {
486486
args := []interface{}{"CF.RESERVE", key, capacity, "MAXITERATIONS", maxiterations}
487487
cmd := NewStatusCmd(ctx, args...)
488488
_ = c(ctx, cmd)
@@ -924,7 +924,7 @@ func (c cmdable) TopKReserve(ctx context.Context, key string, k int64) *StatusCm
924924
// TopKReserveWithOptions creates an empty Top-K filter with the specified number of top items to keep and additional options.
925925
// This function allows for specifying additional options such as width, depth and decay.
926926
// For more information - https://redis.io/commands/topk.reserve/
927-
func (c cmdable) TopKReserveWithOptions(ctx context.Context, key string, k int64, width, depth int64, decay float64) *StatusCmd {
927+
func (c cmdable) TopKReserveWithOptions(ctx context.Context, key string, k, width, depth int64, decay float64) *StatusCmd {
928928
args := []interface{}{"TOPK.RESERVE", key, k, width, depth, decay}
929929

930930
cmd := NewStatusCmd(ctx, args...)

scripting_commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (c cmdable) FCallRO(ctx context.Context, function string, keys []string, ar
201201
return cmd
202202
}
203203

204-
func fcallArgs(command string, function string, keys []string, args ...interface{}) []interface{} {
204+
func fcallArgs(command, function string, keys []string, args ...interface{}) []interface{} {
205205
cmdArgs := make([]interface{}, 3+len(keys), 3+len(keys)+len(args))
206206
cmdArgs[0] = command
207207
cmdArgs[1] = function

0 commit comments

Comments
 (0)