diff --git a/dynamic_tree.go b/dynamic_tree.go index aea8db6..af23a6a 100644 --- a/dynamic_tree.go +++ b/dynamic_tree.go @@ -257,12 +257,14 @@ func (i *Intermediate) String() string { childLines := strings.Split(lines[treeSize-1], "\n") lenChildLines := len(childLines) - out += fmt.Sprintf("%s%s%s\n", NodePad, NodeL, childLines[0]) - for a := 1; a < lenChildLines-2; a++ { - out += fmt.Sprintf("%s%s%s\n", NodePad, NodePad, childLines[a]) - } - if lenChildLines > 0 { + if lenChildLines > 1 { + out += fmt.Sprintf("%s%s%s\n", NodePad, NodeL, childLines[0]) + for a := 1; a < lenChildLines-2; a++ { + out += fmt.Sprintf("%s%s%s\n", NodePad, NodePad, childLines[a]) + } out += fmt.Sprintf("%s%s%s", NodePad, NodePad, childLines[lenChildLines-1]) + } else { + out += fmt.Sprintf("%s%s%s", NodePad, NodeL, childLines[0]) } return out }