author avatar

manu

Wed Sep 18 2019

In go - A final parameter of a function signature maybe prefixed with three dots (...) to be invoked with zero or more arguments, this is called variadic parameter. Also, an empty interface interface{} can hold values of any type. Combine these together and you can have a function parameter ready to accept n similar type arguments of any type func someFun(firstParam, a ...interface{})