RosettaCodeData/Task/Variadic-function/Go/variadic-function-1.go

7 lines
171 B
Go

func printAll(things ... string) {
// it's as if you declared "things" as a []string, containing all the arguments
for _, x := range things {
fmt.Println(x)
}
}