I used gorilla/mux for my routing needs. But I noticed one problem, when I install several Subrouters, this does not work.
Here is an example:
func main() { r := mux.NewRouter().StrictSlash(true) api := r.Path("/api").Subrouter() u := api.Path("/user").Subrouter() u.Methods("GET").HandleFunc(UserHandler) http.ListenAndServe(":8080", r) }
I wanted to use this approach so that I could delegate the filling of the router to another packet, for example user.Populate(api)
However, this does not work. It only works if I use one subprocessor in the chain.
Any ideas?
source share