code: func (r *Router) dispatch(node *Trie, key, path, method, version string, leaf bool, params Params) (http.Handler, Params) {
  	catchall := false
  	if node.name != "" {
  		if params == nil {
  			params = Params{}
  		}
  		params.Add("rname", node.name)
  	}
  	if len(node.Handler) > 0 && leaf {
  		return r.checkMethod(node, method), params
  	} else if node.HasRegex {
  		for _, n := range node.Node {
  			if strings.HasPrefix(n.path, ":") {
  				rx := r.dynamicRoutes[n.path]
  				if rx.MatchString(key) {
  					// add param to context
  					if params == nil {
  						params = Params{}
  					}
  					params.Add(n.path, key)
  					node, key, path, leaf := node.Get(n.path+path, version)
  					return r.dispatch(node, key, path, method, version, leaf, params)
  				}
  			}
  		}
  		if node.HasCatchall {
  			catchall = true
  		}
  	} else if node.HasCatchall {
  		catchall = true
  	}
  	if catchall {
  		for _, n := range node.Node {
  			if n.path == "*" {
  				// add "*" to context
  				if params == nil {
  					params = Params{}
  				}
  				params.Add("*", key)
  				if n.name != "" {
  					params.Add("rname", n.name)
  				}
  				return r.checkMethod(n, method), params
  			}
  		}
  	}
  	// NotFound
  	if r.NotFoundHandler != nil {
  		return r.NotFoundHandler, params
  	}
  	return http.NotFoundHandler(), params
  }
docs: // dispatch request