Added command length tests for DECRBY command. Updated godoc comment for DecrBy embedded API method.

This commit is contained in:
Kelvin Mwinuka
2024-06-25 12:53:19 +08:00
parent e126dc52c7
commit 0111c67368
5 changed files with 44 additions and 25 deletions

View File

@@ -155,9 +155,9 @@ func decrKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
}, nil
}
func decrKeyByFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
if len(cmd) < 3 {
return internal.KeyExtractionFuncResult{}, errors.New("wrong number of arguments for DECRBY")
func decrByKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
if len(cmd) != 3 {
return internal.KeyExtractionFuncResult{}, errors.New(constants.WrongArgsResponse)
}
return internal.KeyExtractionFuncResult{
WriteKeys: []string{cmd[1]},