mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-21 21:47:51 +00:00
23 lines
306 B
Go
23 lines
306 B
Go
|
package assets
|
||
|
|
||
|
import (
|
||
|
"embed"
|
||
|
"io/fs"
|
||
|
)
|
||
|
|
||
|
func ListFiles(content embed.FS) (files []string) {
|
||
|
fs.WalkDir(content, ".", func(path string, d fs.DirEntry, err error) error {
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
if d.IsDir() {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
files = append(files, path)
|
||
|
return nil
|
||
|
})
|
||
|
return
|
||
|
}
|