Lets say an example function like this
func (r *Router) Get(path string, controller interface{}) {}
And I am calling it this way
Route.Get("/", controllers.Test.IsWorking)
Refering to this function
type Test struct {
Name string
}
func (t Test) IsWorking() {
log.Println("hello")
}
How can I get what struct is the function using? I mean on this example the
struct would be Test and the function IsWorking... I have no idea how to
achieve this
Running a reflect TypeOf to controller returns this
func(controllers.Test)
But I am not sure how to create a reflect.New of the type of
controller.Test (without knowing about it)
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.