tree

package module
v0.0.0-...-460e69c Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 4 Imported by: 1

README

Tree

Build Status

Create an text-based tree (like $ tree) from any text using a custom delimiter.

CLI

https://github.com/homburg/tree/

USAGE

package main

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

func main() {

	t := tree.New("-")

	t.EatLines([]string{
		"root"
		"root-first",
		"root-first-second.txt",
		"third",
	})

	fmt.Println(t.Format())
	// Output:
	// root
	// └─── first
	//      └── second.txt
	// third.txt
}

LICENSE(S)

MIT 2016 Thomas B Homburg

LICENSE.md LICENSES.md

Documentation

Index

Constants

View Source
const (
	TEE   = "├── "
	PIPE  = "│   "
	BEND  = "└── "
	WIDTH = len(PIPE)
)

Variables

This section is empty.

Functions

func New

func New(separator string) *tree

Types

This section is empty.

Jump to

Keyboard shortcuts

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