#"strArray..." gives []string

10 messages · Page 1 of 1 (latest)

viscid grove
#

What does it want?

#

Generally that would also be in the error

lone gazelle
#

want (string, ...string)

viscid grove
#

So you can only give it one string and one slice unpack

#

You can't give it multiple strings and then unpack a slice

lone gazelle
#

can I combine them all in 1 slice and unpack it?

#

or 1 normal and others with unpacking

viscid grove
#

Not really in an elegant way, but yes.
If you can get those to the beginning of the slice further up in your code that would be cleanest

#

Otherwise there's technically append([]string{arg1, arg2}, strArray...)...

lone gazelle
#

Thank you very much! it works gopherhappy