MCPcopy
hub / github.com/gin-gonic/gin / addChild

Method addChild

tree.go:71–78  ·  view source on GitHub ↗

addChild will add a child node, keeping wildcardChild at the end

(child *node)

Source from the content-addressed store, hash-verified

69
70// addChild will add a child node, keeping wildcardChild at the end
71func (n *node) addChild(child *node) {
72 if n.wildChild && len(n.children) > 0 {
73 wildcardChild := n.children[len(n.children)-1]
74 n.children = append(n.children[:len(n.children)-1], child, wildcardChild)
75 } else {
76 n.children = append(n.children, child)
77 }
78}
79
80func countParams(path string) uint16 {
81 colons := strings.Count(path, ":")

Callers 2

addRouteMethod · 0.95
insertChildMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected