I am trying to write a Command Line Interface in Go. I have did a lot of work so far but i am stuck at the phase where I literally don't know what to do? How can I write a function that displays the input and output files like a flow tree. For example, If I have a parent file A and B,C,D are present in it, next I have G and E,F are present in it. Can anyone help me with this?
The structure will look like:
A
|
|____ B
|____ C
|____D
G
|
|____ E
|
|____ F
Note: I want to print this structure in console.
You have some libraries already specialized in that kind of output.
For instance: xlab/treeprint
fmt.Println(tree.String())
.
├── one
│ ├── subnode1
│ ├── subnode2
│ ├── two
│ │ ├── subnode1
│ │ ├── subnode2
│ │ └── three
│ │ ├── subnode1
│ │ └── subnode2
│ └── subnode3
└── outernode