redis / go-redis

Redis Go client
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
20.15k stars 2.37k forks source link

[Enhancement/Cleanup] Remove unused argument from `cmdSlot` function in osscluster #3064

Open kapurm17 opened 4 months ago

kapurm17 commented 4 months ago

Description The cmdSlot function in the osscluster.go file accepts two parameters :

  1. context
  2. Cmder

The context argument is not being used in the the function and should be safe to remove.

Code Snippet:

func (c *ClusterClient) cmdSlot(ctx context.Context, cmd Cmder) int {
    args := cmd.Args()
    if args[0] == "cluster" && args[1] == "getkeysinslot" {
        return args[2].(int)
    }

    return cmdSlot(cmd, cmdFirstKeyPos(cmd))
}

CodeRef: https://github.com/redis/go-redis/blob/master/osscluster.go#L1814

What I expect to see?

What version of go-redis are you using? checked the same on the master branch

kapurm17 commented 4 months ago

@chayim @ofekshenawa I can start on the PR, if the change looks good?