I currently have the following code
func (r *Router) Get(path string, controller interface{}) {
...
t := reflect.TypeOf(controller)
...
}
That is called doing the following
Route.Get("/", controllers.Test.IsWorking)
The second argument is basically this
type Test struct {
*Controller
Name string
}
func (t Test) IsWorking() {
}
type Controller struct {
Method string
Request *http.Request
Response http.ResponseWriter
Data map[interface{}]interface{}
}
I want to get the struct the function refers to. create a new struct of that type and call the function so for example
controllers.Test.IsWorking
Create a Test struct and call IsWorking()