projector/dirlist.go
2021-03-10 19:17:13 +00:00

22 lines
392 B
Go

package main
import (
"fmt"
"os"
)
func dirlist() []string {
var output []string
wd, _ := os.Getwd()
dirlist, _ := os.ReadDir(wd)
for _, item := range dirlist {
if os.DirEntry.IsDir(item) {
output = append(output, fmt.Sprintf(wd + "/" + os.DirEntry.Name(item) + "/"))
} else {
output = append(output, fmt.Sprintf(wd + "/" + os.DirEntry.Name(item)))
}
}
return output
}