From 77d6d6d24e7574c49d6c578ac39f5410817abeaf Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 9 Oct 2021 03:04:15 -0500 Subject: NODE: walking around in the rabbit hole --- new-structs.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'new-structs.go') diff --git a/new-structs.go b/new-structs.go index 4c24692..d5aa2fb 100644 --- a/new-structs.go +++ b/new-structs.go @@ -102,14 +102,16 @@ func (n *Node) List() { func (n *Node) ListChildren(dump bool) { log.Println("\tListChildren() node =", n.id, n.Name, n.Width, n.Height) + if (dump == true) { + n.Dump() + } if len(n.children) == 0 { if (n.parent != nil) { log.Println("\t\t\tparent =",n.parent.id) } - log.Println("\t\tNo children START") + log.Println("\t\t", n.id, "has no children") return } - // spew.Dump(n) for _, child := range n.children { log.Println("\t\tListChildren() child =",child.id, child.Name, child.Width, child.Height) if (child.parent != nil) { @@ -118,12 +120,14 @@ func (n *Node) ListChildren(dump bool) { log.Println("\t\t\tno parent") panic("no parent") } + /* if (dump == true) { child.Dump() } + */ if (child.children == nil) { - log.Println("\t\t\tNo children END") - // break + log.Println("\t\t", child.id, "has no children") + break } log.Println("\t\t\tHas children:", child.children) child.ListChildren(dump) -- cgit v1.2.3