notes-server/filetree/dirs.go

20 lines
252 B
Go
Executable File

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())))
}
}