diff --git a/command.go b/command.go index d4323773..1644b8ab 100644 --- a/command.go +++ b/command.go @@ -210,9 +210,9 @@ func (cmd *baseCmd) readRawReply(rd *proto.Reader) (err error) { return err } -// getInterleavedArguments returns arguments at even indices starting from index 0. +// getInterleavedArguments returns arguments at even indices starting from index 1. func (cmd *baseCmd) getInterleavedArguments() []string { - return cmd.getInterleavedArgumentsWithOffset(0) + return cmd.getInterleavedArgumentsWithOffset(1) } // getInterleavedArgumentsWithOffset returns arguments at even indices starting from the specified offset. diff --git a/string_commands.go b/string_commands.go index 292dfb32..d9d1d90a 100644 --- a/string_commands.go +++ b/string_commands.go @@ -151,7 +151,7 @@ func (c cmdable) MSet(ctx context.Context, values ...interface{}) *StatusCmd { args[0] = "mset" args = appendArgs(args, values) cmd := NewStatusCmd(ctx, args...) - cmd.keys = append(cmd.keys, cmd.getInterleavedArgumentsWithOffset(1)...) + cmd.keys = append(cmd.keys, cmd.getInterleavedArguments()...) _ = c(ctx, cmd) return cmd } @@ -166,7 +166,7 @@ func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd { args[0] = "msetnx" args = appendArgs(args, values) cmd := NewBoolCmd(ctx, args...) - cmd.keys = append(cmd.keys, cmd.getInterleavedArgumentsWithOffset(1)...) + cmd.keys = append(cmd.keys, cmd.getInterleavedArguments()...) _ = c(ctx, cmd) return cmd }