Skip to content

Commit 80c373b

Browse files
authored
chore: remove unused param (#3382)
* chore: remove unused param Signed-off-by: fukua95 <fukua95@gmail.com> * chore: rename a unused param to `_` Signed-off-by: fukua95 <fukua95@gmail.com> --------- Signed-off-by: fukua95 <fukua95@gmail.com>
1 parent 3af2cc5 commit 80c373b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ var _ = Describe("ClusterClient", func() {
364364
It("select slot from args for GETKEYSINSLOT command", func() {
365365
cmd := NewStringSliceCmd(ctx, "cluster", "getkeysinslot", 100, 200)
366366

367-
slot := client.cmdSlot(context.Background(), cmd)
367+
slot := client.cmdSlot(cmd)
368368
Expect(slot).To(Equal(100))
369369
})
370370

371371
It("select slot from args for COUNTKEYSINSLOT command", func() {
372372
cmd := NewStringSliceCmd(ctx, "cluster", "countkeysinslot", 100)
373373

374-
slot := client.cmdSlot(context.Background(), cmd)
374+
slot := client.cmdSlot(cmd)
375375
Expect(slot).To(Equal(100))
376376
})
377377
})

osscluster.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error {
981981
}
982982

983983
func (c *ClusterClient) process(ctx context.Context, cmd Cmder) error {
984-
slot := c.cmdSlot(ctx, cmd)
984+
slot := c.cmdSlot(cmd)
985985
var node *clusterNode
986986
var moved bool
987987
var ask bool
@@ -1329,7 +1329,7 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd
13291329

13301330
if c.opt.ReadOnly && c.cmdsAreReadOnly(ctx, cmds) {
13311331
for _, cmd := range cmds {
1332-
slot := c.cmdSlot(ctx, cmd)
1332+
slot := c.cmdSlot(cmd)
13331333
node, err := c.slotReadOnlyNode(state, slot)
13341334
if err != nil {
13351335
return err
@@ -1340,7 +1340,7 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd
13401340
}
13411341

13421342
for _, cmd := range cmds {
1343-
slot := c.cmdSlot(ctx, cmd)
1343+
slot := c.cmdSlot(cmd)
13441344
node, err := state.slotMasterNode(slot)
13451345
if err != nil {
13461346
return err
@@ -1540,7 +1540,7 @@ func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) err
15401540
func (c *ClusterClient) mapCmdsBySlot(ctx context.Context, cmds []Cmder) map[int][]Cmder {
15411541
cmdsMap := make(map[int][]Cmder)
15421542
for _, cmd := range cmds {
1543-
slot := c.cmdSlot(ctx, cmd)
1543+
slot := c.cmdSlot(cmd)
15441544
cmdsMap[slot] = append(cmdsMap[slot], cmd)
15451545
}
15461546
return cmdsMap
@@ -1569,7 +1569,7 @@ func (c *ClusterClient) processTxPipelineNode(
15691569
}
15701570

15711571
func (c *ClusterClient) processTxPipelineNodeConn(
1572-
ctx context.Context, node *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap,
1572+
ctx context.Context, _ *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap,
15731573
) error {
15741574
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
15751575
return writeCmds(wr, cmds)
@@ -1858,7 +1858,7 @@ func (c *ClusterClient) cmdInfo(ctx context.Context, name string) *CommandInfo {
18581858
return info
18591859
}
18601860

1861-
func (c *ClusterClient) cmdSlot(ctx context.Context, cmd Cmder) int {
1861+
func (c *ClusterClient) cmdSlot(cmd Cmder) int {
18621862
args := cmd.Args()
18631863
if args[0] == "cluster" && (args[1] == "getkeysinslot" || args[1] == "countkeysinslot") {
18641864
return args[2].(int)

0 commit comments

Comments
 (0)