Adding subdir support

This commit is contained in:
ngn 2024-01-17 21:39:57 +03:00
parent e050e82b2d
commit 1e9893cfc2

View File

@ -35,6 +35,14 @@ func ListContent(dir string) ([]Content, error) {
}
for _, e := range entries {
if e.IsDir() {
subres, err := ListContent(path.Join(dir, e.Name()))
if err != nil {
return res, err
}
res = append(res, subres...)
}
if(!strings.HasSuffix(e.Name(), ".json")) {
continue
}