Skip to content

Commit 93f6c57

Browse files
committed
Add Walk function and tests for it.
1 parent e6675e3 commit 93f6c57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

walk.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"os"
55
"path/filepath"
66
"sort"
7+
"strings"
78
)
89

910
// Walk walks the file tree rooted at root, calling walkFunc for each file or
@@ -60,7 +61,7 @@ func walk(fs Filesystem, path string, info os.FileInfo, walkFunc filepath.WalkFu
6061
}
6162

6263
for _, name := range names {
63-
filename := filepath.Join(path, name)
64+
filename := strings.Join([]string{path, name}, string(fs.PathSeparator()))
6465
fileInfo, err := fs.Lstat(filename)
6566
if err != nil {
6667
if err := walkFunc(filename, fileInfo, err); err != nil && err != filepath.SkipDir {

0 commit comments

Comments
 (0)