code: func (n *node) Lookup(path string) *httpRoute {
  	cur := n
  	prev := n
  	for part, i := slice(path, 0); ; part, i = slice(path, i) {
  		if part != "" {
  			cur = cur.children[part]
  			if cur == nil {
  				// can't progress any deeper, return last backend we saw
  				return prev.backend
  			}
  			if cur.backend != nil {
  				prev = cur // update last seen backend
  			}
  		}
  		if i == -1 {
  			break
  		}
  	}
  	if cur.backend != nil {
  		return cur.backend
  	}
  	return prev.backend
  }
docs: // lookup returns the best match for a given path