radix
radix copied to clipboard
Flatten with empty slice in struct yields wrong number of arguments
A struct of the form:
struct {
Other string
Nested []string
}
with with Nested
left to it's empty value, generates an invalid number of arguments for HMSET
, leading to the error:
unmarshaling message off Conn: ERR wrong number of arguments for 'hmset' command
Suggested solutions:
- Defaulting for
Nested
to an empty string""
for empty values, consistent with normal empty string values, explicitly emptying the value. - Adding an
omitempty
option, preventing this value from being (over)written withHMSET
.