package filetree import ( "os" "path" ) type Dirs []Path func NewDirs() *Dirs { d := Dirs([]Path{}) return &d } func (d *Dirs) Push(p Path, f os.FileInfo) { if f.IsDir() { *d = append(*d, NewPathFromLocal(path.Join(p.Local, f.Name()))) } }