fix: linter errors in Windows specific code (#18276)

This commit is contained in:
Klaus Post
2023-10-18 11:08:15 -07:00
committed by GitHub
parent b46a717425
commit e37508fb8f
4 changed files with 17 additions and 21 deletions
+4 -4
View File
@@ -80,11 +80,11 @@ func readDirFn(dirPath string, filter func(name string, typ os.FileMode) error)
continue
}
var typ os.FileMode = 0 // regular file
var typ os.FileMode // regular file
switch {
case data.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0:
// Reparse point is a symlink
fi, err := os.Stat(pathJoin(dirPath, string(name)))
fi, err := os.Stat(pathJoin(dirPath, name))
if err != nil {
// It got deleted in the meantime, not found
// or returns too many symlinks ignore this
@@ -153,7 +153,7 @@ func readDirWithOpts(dirPath string, opts readDirOpts) (entries []string, err er
switch {
case data.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0:
// Reparse point is a symlink
fi, err := os.Stat(pathJoin(dirPath, string(name)))
fi, err := os.Stat(pathJoin(dirPath, name))
if err != nil {
// It got deleted in the meantime, not found
// or returns too many symlinks ignore this
@@ -170,7 +170,7 @@ func readDirWithOpts(dirPath string, opts readDirOpts) (entries []string, err er
continue
}
case data.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY != 0:
name = name + SlashSeparator
name += SlashSeparator
}
count--