Fixed incorrect paths on Windows

This commit is contained in:
Eduard Urbach 2024-08-14 12:27:01 +02:00
parent a2effb7db7
commit 9d0077d1a4
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

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
})
}