func (n node) clone() *node {
	cloneNode := new(node)
	cloneNode.nType = n.nType
	cloneNode.path = n.path
	cloneNode.tsr = n.tsr
	cloneNode.handler = n.handler
	if len(n.children) > 0 {
		cloneNode.children = make([]*node, len(n.children))
		for i, child := range n.children {
			cloneNode.children[i] = child.clone()
		}
	}
	if n.wildcard != nil {
		cloneNode.wildcard = &nodeWildcard{
			path:     n.wildcard.path,
			paramKey: n.wildcard.paramKey,
			handler:  n.wildcard.handler,
		}
	}
	if len(n.paramKeys) > 0 {
		cloneNode.paramKeys = make([]string, len(n.paramKeys))
		copy(cloneNode.paramKeys, n.paramKeys)
	}
	cloneNode.paramRegex = n.paramRegex
	return cloneNode
}
clone clones the current node in a new pointer
package radix
import (
	"sort"
	"strings"
	gstrings "github.com/savsgio/gotils/strings"
	"github.com/valyala/bytebufferpool"
	"github.com/valyala/fasthttp"
)
func newNode(path string) *node {
	return &node{
		nType: static,
		path:  path,
	}
}
func (n *nodeWildcard) conflict(path, fullPath string) error {
	prefix := fullPath[:strings.LastIndex(fullPath, path)] + n.path
	return newRadixError(errWildcardConflict, path, fullPath, n.path, prefix)
}
func (n *node) wildPathConflict(path, fullPath string) error {
	pathSeg := strings.SplitN(path, "/", 2)[0]
	prefix := fullPath[:strings.LastIndex(fullPath, path)] + n.path
	return newRadixError(errWildPathConflict, pathSeg, fullPath, n.path, prefix)
}