We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f66cd0 commit 185ec01Copy full SHA for 185ec01
command.go
@@ -75,12 +75,17 @@ func writeCmd(wr *proto.Writer, cmd Cmder) error {
75
return wr.WriteArgs(cmd.Args())
76
}
77
78
+// cmdFirstKeyPos returns the position of the first key in the command's arguments.
79
+// If the command does not have a key, it returns 0.
80
+// TODO: Use the data in CommandInfo to determine the first key position.
81
func cmdFirstKeyPos(cmd Cmder) int {
82
if pos := cmd.firstKeyPos(); pos != 0 {
83
return int(pos)
84
85
86
switch cmd.Name() {
87
+ case "echo", "ping", "command":
88
+ return 0
89
case "eval", "evalsha", "eval_ro", "evalsha_ro":
90
if cmd.stringArg(2) != "0" {
91
return 3
0 commit comments