Returns a list of files.
go get github.com/matt9mg/go-filelist
OS Filesystem
fileList := filelist.NewFileList()
fl, err := fileList.ListFromLocation("/path/to/base_directory")
if err != nil {
log.Fatalln(err)
}
log.Println(fl)
Embed Filesystem
//go:embed a_dir
var files embed.FS
fileList := filelist.NewFileList()
fl, err := fileList.ListFromFS(files, ".")
if err != nil {
log.Fatalln(err)
}
log.Println(fl)
This project is licensed under the MIT License - see the LICENSE.md file for details
We take no legal responsibility for anything this code is used for.