diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-31 17:15:14 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-02-04 00:17:10 +0100 |
commit | 80dd6ddde27ce36f5432fb780e94d4974b5277c7 (patch) | |
tree | 99d0ba7eb2b343b4b65c4433a998d73af3182933 /hugofs/walk_test.go | |
parent | 299731012441378bb9c057ceb0a3c277108aaf01 (diff) |
Fix module mount in sub folder
This addresses a specific issue, but is a also a major simplification of the filesystem file mounts.
Fixes #6730
Diffstat (limited to 'hugofs/walk_test.go')
-rw-r--r-- | hugofs/walk_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hugofs/walk_test.go b/hugofs/walk_test.go index 4effa8000..0c08968c6 100644 --- a/hugofs/walk_test.go +++ b/hugofs/walk_test.go @@ -176,6 +176,27 @@ func collectFilenames(fs afero.Fs, base, root string) ([]string, error) { } +func collectFileinfos(fs afero.Fs, base, root string) ([]FileMetaInfo, error) { + var fis []FileMetaInfo + + walkFn := func(path string, info FileMetaInfo, err error) error { + if err != nil { + return err + } + + fis = append(fis, info) + + return nil + } + + w := NewWalkway(WalkwayConfig{Fs: fs, BasePath: base, Root: root, WalkFn: walkFn}) + + err := w.Walk() + + return fis, err + +} + func BenchmarkWalk(b *testing.B) { c := qt.New(b) fs := NewBaseFileDecorator(afero.NewMemMapFs()) |