mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-25 08:50:24 +08:00
Merge branch 'main' into issue-64
This commit is contained in:
@@ -499,13 +499,11 @@ func (server *EchoVault) IncrBy(key string, value string) (int, error) {
|
||||
func (server *EchoVault) DecrBy(key string, value string) (int, error) {
|
||||
// Construct the command
|
||||
cmd := []string{"DECRBY", key, value}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user