Give a function:
type myFunc func(...interface{}) (interface{})
I'd like to get the type of myFunc, something like:
t := reflect.TypeOf(myFunc)
Or
t := reflect.TypeOf((*myFunc)(nil))
The only way I have found to do this is by first creating a temporary variable of myFunc and then getting the TypeOf from that.
var v myFunc
t := reflect.TypeOf(v)
Is there a better way to do this?