package supertoken import ( "fmt" "github.com/zachmann/mytoken/internal/db/dbModels" ) // SuperTokenEntryTree is a tree of SuperTokenEntry type SuperTokenEntryTree struct { Token dbModels.SuperTokenEntry Children []SuperTokenEntryTree } func (t *SuperTokenEntryTree) print(level int) { for i := 0; i < 2*level; i++ { fmt.Printf(" ") } fmt.Printf("%s\n", t.Token.ID) for _, child := range t.Children { child.print(level + 1) } }