Skip to content

Commit

Permalink
fixed a bug on test
Browse files Browse the repository at this point in the history
  • Loading branch information
0x23d11 committed Jun 23, 2024
1 parent cebc72b commit 90b3d40
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions echovault/api_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,17 @@ func (server *EchoVault) Incr(key string) (int, error) {
// Parse the integer response
return internal.ParseIntegerResponse(b)
}

func (server *EchoVault) Decr(key string) (int, error) {
// Construct the command
cmd := []string{"DECR", key}

// Execute the command
b, err := server.handleCommand(server.context, internal.EncodeCommand(cmd), nil, false, true)
if err != nil {
return 0, err
}

// Parse the integer response
return internal.ParseIntegerResponse(b)
}

0 comments on commit 90b3d40

Please sign in to comment.