diff --git a/go/api/response_handlers.go b/go/api/response_handlers.go index 31f8d67981..192d814c6c 100644 --- a/go/api/response_handlers.go +++ b/go/api/response_handlers.go @@ -274,7 +274,9 @@ func handleDoubleOrNullResponse(response *C.struct_CommandResponse) (Result[floa if typeErr != nil { return CreateNilFloat64Result(), typeErr } - + if response.response_type == C.Null { + return CreateNilFloat64Result(), nil + } return CreateFloat64Result(float64(response.float_value)), nil } diff --git a/go/api/sorted_set_commands.go b/go/api/sorted_set_commands.go index f34dcc96fc..ed3956824f 100644 --- a/go/api/sorted_set_commands.go +++ b/go/api/sorted_set_commands.go @@ -80,7 +80,8 @@ type SortedSetCommands interface { // opts - The options for the command. See [ZAddOptions] for details. // // Return value: - // Result[float64] - The new score of the member. + // The new score of the member. + // If there was a conflict with the options, the operation aborts and `nil` is returned. // // Example: // res, err := client.ZAddIncrWithOptions(key, "one", 1.0, options.NewZAddOptionsBuilder().SetChanged(true)) diff --git a/go/integTest/shared_commands_test.go b/go/integTest/shared_commands_test.go index a4573efc9a..966beb4b25 100644 --- a/go/integTest/shared_commands_test.go +++ b/go/integTest/shared_commands_test.go @@ -4225,7 +4225,7 @@ func (suite *GlideTestSuite) TestZAddAndZAddIncr() { assert.Equal(suite.T(), int64(3), res.Value()) resIncr, err = client.ZAddIncrWithOptions(key3, "one", 5, onlyIfDoesNotExistOpts) - assert.NotNil(suite.T(), err) + assert.Nil(suite.T(), err) assert.True(suite.T(), resIncr.IsNil()) resIncr, err = client.ZAddIncrWithOptions(key3, "one", 5, onlyIfExistsOpts) @@ -4263,7 +4263,7 @@ func (suite *GlideTestSuite) TestZAddAndZAddIncr() { assert.Equal(suite.T(), float64(7), resIncr.Value()) resIncr, err = client.ZAddIncrWithOptions(key4, "one", -3, gtOpts) - assert.NotNil(suite.T(), err) + assert.Nil(suite.T(), err) assert.True(suite.T(), resIncr.IsNil()) }) }