Skip to content

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

Closed
@kapurm17

Description

@kapurm17

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?

  • Remove context from the cmdSlot function definition and all the instances where we are calling this from.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions