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

wrong number of arguments for 'hmset' command #44

Closed
danvonk opened this issue Nov 2, 2013 · 2 comments
Closed

wrong number of arguments for 'hmset' command #44

danvonk opened this issue Nov 2, 2013 · 2 comments

Comments

@danvonk
Copy link

danvonk commented Nov 2, 2013

Hi,
I tried to copy the struct example at http://godoc.org/github.com/garyburd/redigo/redis#example-Args but i kept getting the error, "ERR wrong number of arguments for 'hmset' command"

func main() {
c, err := redis.Dial("tcp", "127.0.0.1:6379")
if err != nil {
    panic(err)
}

ss := &somestruct{}
ss.a = "apple"
ss.b = "banana"

if _, err := c.Do("HMSET", redis.Args{}.Add("id1").AddFlat(ss)...); err != nil {
    panic(err)
}

}
/*
/go/bin$ go run redis.go
panic: ERR wrong number of arguments for 'hmset' command

goroutine 1 [running]:
main.main()
/go/bin/redis.go:23 +0x389

goroutine 2 [syscall]:
exit status 2
*/

although, if i just enter my values in manually, it seems to work.

@garyburd
Copy link
Member

garyburd commented Nov 2, 2013

The example will work as expected if you export the fields.

I will update the documentation to note that exported identifiers are required.

@garyburd garyburd closed this as completed Nov 2, 2013
@danvonk
Copy link
Author

danvonk commented Nov 2, 2013

completely forgot about that, thanks!

@gomodule gomodule locked and limited conversation to collaborators Dec 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants