trie.go
func (p *prefixTrie) String() string {
	children := []string{}
	padding := strings.Repeat("| ", p.level()+1)
	for bits, child := range p.children {
		if child == nil {
			continue
		}
		childStr := fmt.Sprintf("\n%s%d--> %s", padding, bits, child.String())
		children = append(children, childStr)
	}
	return fmt.Sprintf("%s (target_pos:%d:has_entry:%t)%s", p.network,
		p.targetBitPosition(), p.hasEntry(), strings.Join(children, ""))
}
func (p *prefixTrie) String() string {
	children := []string{}
	padding := strings.Repeat("| ", p.level()+1)
	for bits, child := range p.children {
		if child == nil {
			continue
		}
		childStr := fmt.Sprintf("\n%s%d--> %s", padding, bits, child.String())
		children = append(children, childStr)
	}
	return fmt.Sprintf("%s (target_pos:%d:has_entry:%t)%s", p.network,
		p.targetBitPosition(), p.hasEntry(), strings.Join(children, ""))
}
func ( p * prefixTrie ) String ( ) string { children := [ ] string { } padding := strings . Repeat ( " " , p . level ( ) + 1 ) for bits , child := range p . children { if child == nil { continue } childStr := fmt . Sprintf ( " \n " , padding , bits , child . String ( ) ) children = append ( children , childStr ) } return fmt . Sprintf ( " " , p . network , p . targetBitPosition ( ) , p . hasEntry ( ) , strings . Join ( children , " " ) ) }
// String returns string representation of trie, mainly for visualization and
// debugging.
String returns string representation of trie mainly for visualization and debugging .