Skip to content

Commit

Permalink
fine tune listAllFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Apr 10, 2023
1 parent bb7b7f7 commit 0a44b9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/assetfs/layered.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ func (l *LayeredFS) ListFiles(name string, fileMode ...bool) ([]string, error) {
// * true: only files will be returned.
// * false: only directories will be returned.
func (l *LayeredFS) ListAllFiles(name string, fileMode ...bool) ([]string, error) {
return l.listAllFiles(l.layers, name, fileMode...)
return listAllFiles(l.layers, name, fileMode...)
}

func (l *LayeredFS) listAllFiles(layers []*Layer, name string, fileMode ...bool) ([]string, error) {
func listAllFiles(layers []*Layer, name string, fileMode ...bool) ([]string, error) {
fileMap := map[string]bool{}
var list func(dir string) error
list = func(dir string) error {
Expand Down Expand Up @@ -216,7 +216,7 @@ func (l *LayeredFS) WatchLocalChanges(ctx context.Context, callback func()) {
if layer.localPath == "" {
continue
}
layerDirs, err := l.listAllFiles([]*Layer{layer}, ".", false)
layerDirs, err := listAllFiles([]*Layer{layer}, ".", false)
if err != nil {
log.Error("Unable to list directories for asset local file-system %q: %v", layer.localPath, err)
continue
Expand Down

0 comments on commit 0a44b9c

Please sign in to comment.