This question already has an answer here:
- Does Golang support variadic function? 3 answers
func foo(x... int) {
//Do something with the arguments.
}
Function foo takes any number of arguments of a particular type. How do I read those arguments inside the function?
I can do so when a slice of int is passed to the function foo but not if arguments are not passed as a slice of int.
</div>