consider symlinks to directories when pushing to scan stack

https://github.com/karrick/godirwalk/pull/45
https://github.com/sentriz/gonic/issues/27
This commit is contained in:
sentriz
2020-01-28 23:53:26 +00:00
parent 47411b4169
commit bdee11dfb6
3 changed files with 8 additions and 4 deletions

View File

@@ -200,7 +200,11 @@ func (s *Scanner) callbackItem(fullPath string, info *godirwalk.Dirent) error {
filename: filename,
stat: stat,
}
if info.IsDir() {
isDir, err := info.IsDirOrSymlinkToDir()
if err != nil {
return errors.Wrap(err, "stating link to dir")
}
if isDir {
return s.handleFolder(it)
}
lowerFilename := strings.ToLower(filename)