tree

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2016 License: MIT Imports: 4 Imported by: 0

README

tree - A Library for Printing Tree Structures

tree makes it tree-vial to print out tree structures.

package main

import (
	"fmt"
	"github.com/jhunt/tree"
)

func main() {
	t := tree.New("a",
		tree.New("b"),
		tree.New("c"),
	)

	fmt.Printf("%s\n", t.Draw())
}

Will print out a nicely formatted tree, using ANSI line graphics:

.
└── a
    ├── b
    └── c

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name string
	Sub  []Node
}

func New

func New(name string, sub ...Node) Node

func (*Node) Append

func (n *Node) Append(child Node)

func (Node) Draw

func (n Node) Draw() string

func (Node) Paths

func (n Node) Paths(sep string) []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL