How to pass variable length arguments as arguments on another function in Golang?

Solution 1:

Ah found it...functions that accept variable length arguments are called Variadic Functions. Example:

package main

import "fmt"

func MyPrint(format string, args ...interface{}) {
  fmt.Printf("[MY PREFIX] " + format, args...)
}

func main() {
 MyPrint("yay %d %d\n",123,234);
 MyPrint("yay %d\n ",123);
 MyPrint("yay %d\n");
}