Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten with empty slice in struct yields wrong number of arguments #330

Open
dokterbob opened this issue Oct 8, 2022 · 0 comments
Open

Comments

@dokterbob
Copy link

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:

  1. Defaulting for Nested to an empty string "" for empty values, consistent with normal empty string values, explicitly emptying the value.
  2. Adding an omitempty option, preventing this value from being (over)written with HMSET.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant