When I compile the following program
func myPrint(v ...interface{}) {
fmt.Println("Hello", v...)
}
func main() {
myPrint("new", "world")
}
I get a compilation error
too many arguments in call to fmt.Println
I thought v... is going to expand into 2nd, 3rd arguments and the fmt.Println would see three item variadic argument list. I thought it would be equivalent to
fmt.Println("Hello", "new", "world")
Why is it giving an error.