File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -75,20 +75,21 @@ const (
7575 value = 2
7676)
7777
78+ var ErrArgsLen = errors .New ("ERR wrong number of arguments for command" )
79+
7880func (r * Redis ) validateCmd (cmd redcon.Command ) error {
7981 if len (cmd .Args ) == 0 {
80- return errors . New ( "ERR wrong number of arguments for '" + string ( cmd . Args [ 0 ]) + "' command" )
82+ return ErrArgsLen
8183 }
8284
8385 if len (cmd .Args ) < argsLen [string (cmd .Args [commandName ])] {
84- return errors . New ( "ERR wrong number of arguments for '" + string ( cmd . Args [ 0 ]) + "' command" )
86+ return ErrArgsLen
8587 }
8688
8789 // check args length
8890 plainCmd := strings .ToUpper (string (cmd .Args [commandName ]))
89-
9091 if len (cmd .Args ) != argsLen [plainCmd ] {
91- return errors . New ( "ERR wrong number of arguments for '" + string ( cmd . Args [ 0 ]) + "' command" )
92+ return ErrArgsLen
9293 }
9394
9495 return nil
You can’t perform that action at this time.
0 commit comments