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

Cant pass []string in Do("SINTER"...) #37

Closed
funvit opened this issue Jul 29, 2013 · 1 comment
Closed

Cant pass []string in Do("SINTER"...) #37

funvit opened this issue Jul 29, 2013 · 1 comment

Comments

@funvit
Copy link

funvit commented Jul 29, 2013

Sorry. Cant understand.

Why this works:

redis.Strings(redis_connection.Do("SINTER", "site.posts.index.tag=2", "site.posts.index.tag=10"))

but next - NOT (no result)

my_keys := make([]interface{}, 0)
my_keys = append(my_keys, "site.posts.index.tag=2")
my_keys = append(my_keys, "site.posts.index.tag=10")

redis.Strings(redis_connection.Do("SINTER", my_keys))
@garyburd
Copy link
Member

Change the last line to:

 redis.Strings(redis_connection.Do("SINTER", my_keys...))

The second parameter to Do is variadic. See http://golang.org/ref/spec#Passing_arguments_to_..._parameters for information on using variadic parameters.

The title of this issue says that []string cannot be passed to Do. See http://golang.org/doc/faq#convert_slice_of_interface for a brief description on why []string cannot be used as the variadic parameter.

@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