code: func (t *Trie) Set(path []string, handler http.Handler, method, version string) (*Trie, error) {
  	if len(path) == 0 {
  		return nil, errors.New("path cannot be empty")
  	}
  
  	key := path[0]
  	newpath := path[1:]
  
  	node, ok := t.contains(key, version)
  
  	if !ok {
  		node = &Trie{
  			path:    key,
  			version: version,
  		}
  		t.Node = append(t.Node, node)
  
  		// check for regex ":"
  		if strings.HasPrefix(key, ":") {
  			t.HasRegex = true
  		}
  
  		// check for Catch-all "*"
  		if key == "*" {
  			t.HasCatchall = true
  		}
  	}
  
  	if len(newpath) == 0 {
  		methods := strings.FieldsFunc(method, func(c rune) bool {
  			return c == ','
  		})
  		for _, v := range methods {
  			node.Handler = append(node.Handler, MethodHandler{strings.ToUpper(strings.TrimSpace(v)), handler})
  		}
  		return node, nil
  	}
  
  	if key == "*" {
  		return nil, errors.New("catch-all \"*\" must always be the final path element")
  	}
  
  	return node.Set(newpath, handler, method, version)
  }
docs: // Set adds a node (url part) to the Trie