How do you create a slice of functions with different signatures? I tried the code below but its feels hack-ish. Do we just bite the bullet and use a slice interface{}?
depends on what the different you need. upon your example, we could use variadic.
package main import( "fmt" "strings" ) func foo(ss ...string) string{ return strings.Join(ss, " ") } func main(){ fmt.Println(foo("one")) fmt.Println(foo("one", "two")) fmt.Println(foo("one", "two", "three")) }