I have a func registry but I don't know how can I call a HTTP func on it.
registry := map[string]func(){
"MyFunc1": MyFunc1,
}
registry["MyFunc1"]()
func MyFunc1(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hi Gorilla!"))
}
I changed them to these:
registry := map[string]func(http.ResponseWriter, *http.Request){
"MyFunc1": MyFunc1,
}
But I can not call it now!
gorilla.HandleFunc("/", registry["MyFunc1"]()).Name(parentKey)