Given a function declared as
func foo(bars ...string) {
// ...
}
I'd like to call this like so:
bar1 := "whiskey bar"
rest := []string{"vodka bar", "wine bar"}
foo(bar1, rest...)
but this doesn't compile; the last line errors with this message:
have (string, []string...)
want (...[]string)
Is there a way I can declare a variadic function so that it can be called with both zero or more parameters that are values, and zero or one array of values (at the end)?