mirror of
https://github.com/mudler/LocalAI.git
synced 2024-06-07 19:40:48 +00:00
2cd4936c99
first group of error handlers to reduce security scanner warning noise level Signed-off-by: Dave Lee <dave@gray101.com>
28 lines
431 B
Go
28 lines
431 B
Go
package assets
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
func ListFiles(content embed.FS) (files []string) {
|
|
err := 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
|
|
})
|
|
if err != nil {
|
|
log.Error().Err(err).Msg("error walking the embedded filesystem")
|
|
}
|
|
return
|
|
}
|