func (r *Router) Find(req *http.Request) (h http.HandlerFunc) {
	cn := r.root
	h = notFoundHandler
	if !validMethod(req.Method) {
		h = methodNotAllowedHandler(cn.resource.allowedMethods)
		return
	}
	var (
		search = req.URL.Path
		c      *node   
		n      int     
		nt     ntype   
		nn     *node   
		ns     string  
	)
	for {
		if search == "" {
			if cn.resource != nil {
				theHandler, allowedMethods := cn.resource.GetMethodHandler(req.Method)
				if theHandler == nil {
					if uint16(req.Method[0])<<8|uint16(req.Method[1]) == 0x4f50 {
						h = optionsHandler(r.globalCors, cn.resource.Cors, allowedMethods)
						return
					}
					if allowedMethods != "" {
						h = methodNotAllowedHandler(allowedMethods)
					}
					return
				}
				h = corsFlightWrapper(r.globalCors, cn.resource.Cors, allowedMethods, theHandler)
			}
			return
		}
		pl := 0  
		l := 0   
		if cn.label != ':' {
			sl := len(search)
			pl = len(cn.prefix)
			max := pl
			if sl < max {
				max = sl
			}
			for ; l < max && search[l] == cn.prefix[l]; l++ {
			}
		}
		if l == pl {
			search = search[l:]
		} else {
			cn = nn
			search = ns
			if nt == ptype {
				goto Param
			} else if nt == mtype {
				goto MatchAny
			} else {
				return
			}
		}
		if search == "" {
			if cn.findChildWithType(mtype) == nil {
				continue
			}
			goto MatchAny
		}
		c = cn.findChild(search[0], stype)
		if c != nil {
			if cn.label == '/' {
				nt = ptype
				nn = cn
				ns = search
			}
			cn = c
			continue
		}
	Param:
		c = cn.findChildWithType(ptype)
		if c != nil {
			if cn.label == '/' {
				nt = mtype
				nn = cn
				ns = search
			}
			cn = c
			i, l := 0, len(search)
			for ; i < l && search[i] != '/'; i++ {
			}
			registerVar(req, cn.fmtpnames[n], search[:i])
			n++
			search = search[i:]
			continue
		}
	MatchAny:
		c = cn.findChildWithType(mtype)
		if c != nil {
			cn = c
			registerVar(req, cn.fmtpnames[len(cn.pnames)-1], search)
			search = ""  
			continue
		}
		return
	}
}
Find - Find A route within the router tree
package vestigo
import "net/http"
const (
	stype ntype = iota
	ptype
	mtype
)
type (
	ntype    uint8
	children []*node
)
type Router struct {
	root       *node
	globalCors *CorsAccessControl
}
func NewRouter() *Router {
	return &Router{
		root: &node{
			resource: newResource(),
		},
	}
}
func (r *Router) SetGlobalCors(c *CorsAccessControl) {
	r.globalCors = c
}
func (r *Router) SetCors(path string, c *CorsAccessControl) {
	r.addWithCors("CORS", path, nil, c)
}
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
	h := r.Find(req)
	h(w, req)
}
func (r *Router) Get(path string, handler http.HandlerFunc) {
	r.Add("GET", path, handler)
}
func (r *Router) Post(path string, handler http.HandlerFunc) {
	r.Add("POST", path, handler)
}
func (r *Router) Connect(path string, handler http.HandlerFunc) {
	r.Add("CONNECT", path, handler)
}
func (r *Router) Delete(path string, handler http.HandlerFunc) {
	r.Add("DELETE", path, handler)
}
func (r *Router) Patch(path string, handler http.HandlerFunc) {
	r.Add("PATCH", path, handler)
}
func (r *Router) Put(path string, handler http.HandlerFunc) {
	r.Add("PUT", path, handler)
}
func (r *Router) Trace(path string, handler http.HandlerFunc) {
	r.Add("TRACE", path, handler)
}
func (r *Router) Handle(path string, handler http.Handler) {
	for _, v := range methods {
		if v != "HEAD" || v != "OPTIONS" || v != "TRACE" {
			r.Add(v, path, handler.ServeHTTP)
		}
	}
}
func (r *Router) HandleFunc(path string, handler http.HandlerFunc) {
	for _, v := range methods {
		if v != "HEAD" || v != "OPTIONS" || v != "TRACE" {
			r.Add(v, path, handler)
		}
	}
}
func (r *Router) addWithCors(method, path string, h http.HandlerFunc, cors *CorsAccessControl) {
	r.add(method, path, h, cors)
}
func (r *Router) Add(method, path string, h http.HandlerFunc) {
	r.add(method, path, h, nil)
}
func (r *Router) add(method, path string, h http.HandlerFunc, cors *CorsAccessControl) {
	pnames := []string{}  
	for i, l := 0, len(path); i < l; i++ {
		if path[i] == ':' {
			j := i + 1
			r.insert(method, path[:i], nil, stype, nil, cors)
			for ; i < l && path[i] != '/'; i++ {
			}
			pnames = append(pnames, path[j:i])
			path = path[:j] + path[i:]
			i, l = j, len(path)
			if i == l {
				r.insert(method, path[:i], h, ptype, pnames, cors)
				return
			}
			r.insert(method, path[:i], nil, ptype, pnames, cors)
		} else if path[i] == '*' {
			r.insert(method, path[:i], nil, stype, nil, cors)
			pnames = append(pnames, "_name")
			r.insert(method, path[:i+1], h, mtype, pnames, cors)
			return
		}
	}
	r.insert(method, path, h, stype, pnames, cors)
}