Home / Function/ addChild() — gin Function Reference

addChild() — gin Function Reference

Architecture documentation for the addChild() function in tree.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  52b021ff_6220_b2f1_d6cf_3a67e18c9f64["addChild()"]
  1e254bd3_e110_d850_2675_5cdfb2b748aa["addRoute()"]
  1e254bd3_e110_d850_2675_5cdfb2b748aa -->|calls| 52b021ff_6220_b2f1_d6cf_3a67e18c9f64
  1a47c43a_b5cc_8545_a924_5d7bc35fb4bc["insertChild()"]
  1a47c43a_b5cc_8545_a924_5d7bc35fb4bc -->|calls| 52b021ff_6220_b2f1_d6cf_3a67e18c9f64
  style 52b021ff_6220_b2f1_d6cf_3a67e18c9f64 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tree.go lines 71–78

func (n *node) addChild(child *node) {
	if n.wildChild && len(n.children) > 0 {
		wildcardChild := n.children[len(n.children)-1]
		n.children = append(n.children[:len(n.children)-1], child, wildcardChild)
	} else {
		n.children = append(n.children, child)
	}
}

Domain

Subdomains

Frequently Asked Questions

What does addChild() do?
addChild() is a function in the gin codebase.
What calls addChild()?
addChild() is called by 2 function(s): addRoute, insertChild.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free