golang dispatch method call according to a map[string]somestruct
问题 Assuming I have lots of functions or methods with receiver, each of which has different type of parameters. I want to use table-driven method to dispatch function or method call. So I'll construct a table like this: type command struct { name string handler func(parameter ...interface{}) // I don't know whether to use `...interface{}` is correct } table := map[string]command { ... } func (c command)foo(f1 int, f2 string) {} func (c command)bar(b1 bool, b2 int, b3 string) {} // methods and so