Fixed incorrect paths on Windows
This commit is contained in:
parent
a2effb7db7
commit
9d0077d1a4
@ -12,11 +12,13 @@ import (
|
|||||||
// It doesn't distinguish between files and directories.
|
// It doesn't distinguish between files and directories.
|
||||||
func Walk(directory string, callBack func(string)) error {
|
func Walk(directory string, callBack func(string)) error {
|
||||||
return filepath.WalkDir(directory, func(path string, d fs.DirEntry, err error) error {
|
return filepath.WalkDir(directory, func(path string, d fs.DirEntry, err error) error {
|
||||||
if strings.HasPrefix(d.Name(), ".") {
|
fileName := d.Name()
|
||||||
|
|
||||||
|
if strings.HasPrefix(fileName, ".") {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
|
||||||
callBack(path)
|
callBack(fileName)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user