Skip to content

Konstantin8105/tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GitHub license GoDoc

tree

tree is tree viewer.

minimal example:

func ExampleTree() {
	artist := tree.New("Pantera")
	album := tree.New("Far Beyond Driven")
	album.Add("5 minutes Alone")
	album.Add("Some another")
	artist.Add(album)
	artist.Add("Power Metal")
	fmt.Fprintf(os.Stdout, "%s\n", artist)

	// Output:
	// Pantera
	// ├──Far Beyond Driven
	// │  ├──5 minutes Alone
	// │  └──Some another
	// └──Power Metal
}

Documentation:

package tree // import "github.com/Konstantin8105/tree"

Package tree create and print tree.

TYPES

type Tree struct {
	Name string
	// Has unexported fields.
}
    Tree struct of tree

func New(name string) (tr *Tree)
    New returns a new tree

func (t *Tree) Add(node interface{})
    Add node in tree

func (t Tree) String() (out string)
    String return string with tree view

About

tree viewer

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages