File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 11# ![ GoTree] ( https://rawgit.com/DiSiqueira/GoTree/master/gotree-logo.png )
22
3- # GoTree ![ Language Badge] ( https://img.shields.io/badge/Language-Go-blue.svg ) ![ Go Report] ( https://goreportcard.com/badge/github.com/DiSiqueira/GoTree ) ![ License Badge] ( https://img.shields.io/badge/License-MIT-blue.svg ) ![ Status Badge] ( https://img.shields.io/badge/Status-Beta-brightgreen.svg )
3+ # GoTree ![ Language Badge] ( https://img.shields.io/badge/Language-Go-blue.svg ) ![ Go Report] ( https://goreportcard.com/badge/github.com/DiSiqueira/GoTree ) ![ License Badge] ( https://img.shields.io/badge/License-MIT-blue.svg ) ![ Status Badge] ( https://img.shields.io/badge/Status-Beta-brightgreen.svg ) [ ![ GoDoc ] ( https://godoc.org/github.com/DiSiqueira/GoTree?status.svg )] ( https://godoc.org/github.com/DiSiqueira/GoTree )
44
55Simple Go module to print tree structures in terminal. Heavily inpired by [ The Tree Command for Linux] [ treecommand ]
66
Original file line number Diff line number Diff line change 11package gotree_test
22
33import (
4- "testing "
4+ "fmt "
55
66 gotree "github.com/DiSiqueira/GoTree"
77)
88
9- func TestLast (t * testing.T ) {
10- want := `Pantera
11- ├── Far Beyond Driven
12- │ └── 5 minutes Alone
13- └── Power Metal
14- `
15-
9+ func ExampleTree () {
1610 artist := gotree .New ("Pantera" )
1711 album := artist .Add ("Far Beyond Driven" )
1812 album .Add ("5 minutes Alone" )
1913 artist .Add ("Power Metal" )
14+ fmt .Println (artist .Print ())
2015
21- got := artist . Print ()
22- if got != want {
23- t . Errorf ( "Expected: \n %s \n " , want )
24- t . Errorf ( "Got: \n %s \n " , got )
25- }
16+ // Output:
17+ // Pantera
18+ // ├── Far Beyond Driven
19+ // │ └── 5 minutes Alone
20+ // └── Power Metal
2621}
You can’t perform that action at this time.
0 commit comments