code: func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
  	// Clean path to canonical form and redirect.
  	if p := cleanPath(req.URL.Path); p != req.URL.Path {
  		w.Header().Set("Location", p)
  		w.WriteHeader(http.StatusMovedPermanently)
  		return
  	}
  	var match mux.RouteMatch
  	var handler http.Handler
  	if matched := r.Match(req, &match); matched {
  		handler = match.Handler
  		registerVars(req, match.Vars)
  	}
  	if handler == nil {
  		if r.NotFoundHandler == nil {
  			r.NotFoundHandler = http.NotFoundHandler()
  		}
  		handler = r.NotFoundHandler
  	}
  	if !r.KeepContext {
  		defer context.Clear(req)
  	}
  	handler.ServeHTTP(w, req)
  }
docs: // ServeHTTP dispatches the handler registered in the matched route.