Files
Gogs/conf/embed.go
ᴊᴏᴇ ᴄʜᴇɴ 59e9fa191b chore: remove all MIT license file headers (#8083)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2026-01-08 19:32:15 -05:00

24 lines
485 B
Go

package conf
import (
"embed"
)
//go:embed app.ini **/*
var Files embed.FS
// FileNames returns a list of filenames exists in the given direction within
// Files. The list includes names of subdirectories.
func FileNames(dir string) ([]string, error) {
entries, err := Files.ReadDir(dir)
if err != nil {
return nil, err
}
fileNames := make([]string, 0, len(entries))
for _, entry := range entries {
fileNames = append(fileNames, entry.Name())
}
return fileNames, nil
}