In the Go language,
[]string is a string array
[]string
and we also use ...string as a parameter.
...string
What is the difference?
Functi
Here is what you want:
var args []string = []string{"A", "B", "C"} func Sample(args ...string) { for _, arg := range args { fmt.Println(arg) } } func main() { Sample(args...) }
Play: http://play.golang.org/p/N1ciDUKfG1