title: Nesting subrouters in Gorilla Mux
body: <p>I've been using <a href="https://github.com/gorilla/mux" rel="noreferrer"><code>gorilla/mux</code></a> for my routing needs. But I noticed one problem, when I nest multiple Subrouters it doesn't work.</p>
  
  <p>Here is the example:</p>
  
  <pre><code>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)
  }
  </code></pre>
  
  <p>I wanted to use this approach so I can delegate populating the router to some other package, for example <code>user.Populate(api)</code></p>
  
  <p>However this doesn't seem to work. It works only if I use single Subrouter in the chain.</p>
  
  <p>Any ideas?</p>