func build(root *Node, path []string) {
	child := &Node{Name: path[0]}
	if len(path) == 1 {
		root.Children = append(root.Children, child)
		return
	}
	temp := child
	for _, name := range path[1:] {
		c := &Node{Name: name}
		child.Children = append(child.Children, c)
		child = c
	}
	child = temp
	for _, r := range root.Children {
		if r.Name == child.Name {
			if !foundMatch(r, child.Children) {
				r.Children = append(r.Children, child.Children...)
			}
			return
		}
	}
	root.Children = append(root.Children, child)
}
build constructs the tree.

path will be something like [root, folder, subfolder, file]
package tree
import (
	"fmt"
	"strings"
)
type Node struct {
	Name     string
	Children []*Node
}
func Print(paths []string) {
	root := Build(paths)
	start := "│  "
	for i, r := range root.Children {
		if i == len(root.Children)-1 {
			fmt.Println("└──", r.Name)
			start = "   "
		} else {
			fmt.Println("├──", r.Name)
		}
		printChildren(r, "", start)
	}
}
func Build(paths []string) *Node {
	root := &Node{}
	for _, p := range paths {
		build(root, strings.Split(p, "/"))
	}
	return root
}