Fixed incorrect paths on Windows

This commit is contained in:
Eduard Urbach 2024-08-14 12:27:01 +02:00
parent 515fc5ce6e
commit 7eff85cb2e
Signed by: eduard
GPG key ID: 49226B848C78F6C8

View file

@ -12,11 +12,13 @@ import (
// It doesn't distinguish between files and directories.
func Walk(directory string, callBack func(string)) 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
}
callBack(path)
callBack(fileName)
return nil
})
}