diff --git a/go/api/response_handlers.go b/go/api/response_handlers.go index 08714c8b22..088624a885 100644 --- a/go/api/response_handlers.go +++ b/go/api/response_handlers.go @@ -207,13 +207,13 @@ func handleStringToStringMapResponse(response *C.struct_CommandResponse) (map[Re func handleStringSetResponse(response *C.struct_CommandResponse) (map[Result[string]]struct{}, error) { defer C.free_command_response(response) - typeErr := checkResponseType(response, C.Sets, false) + typeErr := checkResponseType(response, C.Array, false) if typeErr != nil { return nil, typeErr } - slice := make(map[Result[string]]struct{}, response.sets_value_len) - for _, v := range unsafe.Slice(response.sets_value, response.sets_value_len) { + slice := make(map[Result[string]]struct{}, response.array_value_len) + for _, v := range unsafe.Slice(response.array_value, response.array_value_len) { res, err := convertCharArrayToString(&v, true) if err != nil { return nil, err diff --git a/go/src/lib.rs b/go/src/lib.rs index 021561d708..95e2d3523b 100644 --- a/go/src/lib.rs +++ b/go/src/lib.rs @@ -57,13 +57,6 @@ pub struct CommandResponse { map_key: *mut CommandResponse, #[derivative(Default(value = "std::ptr::null_mut()"))] map_value: *mut CommandResponse, - - /// Below two values are related to each other. - /// `sets_value` represents the set of CommandResponse. - /// `sets_value_len` represents the length of the set. - #[derivative(Default(value = "std::ptr::null_mut()"))] - sets_value: *mut CommandResponse, - sets_value_len: c_long, } #[repr(C)] @@ -77,7 +70,6 @@ pub enum ResponseType { String = 4, Array = 5, Map = 6, - Sets = 7, } /// Success callback that is called when a command succeeds. @@ -252,7 +244,6 @@ pub extern "C" fn get_response_type_string(response_type: ResponseType) -> *mut ResponseType::String => "String", ResponseType::Array => "Array", ResponseType::Map => "Map", - ResponseType::Sets => "Sets", }; let c_str = CString::new(s).unwrap_or_default(); c_str.into_raw() @@ -309,8 +300,6 @@ fn free_command_response_elements(command_response: CommandResponse) { let array_value_len = command_response.array_value_len; let map_key = command_response.map_key; let map_value = command_response.map_value; - let sets_value = command_response.sets_value; - let sets_value_len = command_response.sets_value_len; if !string_value.is_null() { let len = string_value_len as usize; unsafe { Vec::from_raw_parts(string_value, len, len) }; @@ -328,13 +317,6 @@ fn free_command_response_elements(command_response: CommandResponse) { if !map_value.is_null() { unsafe { free_command_response(map_value) }; } - if !sets_value.is_null() { - let len = sets_value_len as usize; - let vec = unsafe { Vec::from_raw_parts(sets_value, len, len) }; - for element in vec.into_iter() { - free_command_response_elements(element); - } - } } /// Frees the error_message received on a command failure. @@ -482,9 +464,9 @@ fn valkey_value_to_command_response(value: Value) -> RedisResult