Skip to content

Commit

Permalink
Update file.go
Browse files Browse the repository at this point in the history
  • Loading branch information
qjfoidnh committed Dec 24, 2024
1 parent b179380 commit b0684b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pcsutil/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ func WalkDir(dirPth, suffix string) (files []string, err error) {
if err != nil || fileInfo.Size() == 0 {
return nil
}
if fileInfo.Mode()&os.ModeSymlink != 0 { // 读取 symbol link
targetFileInfo, _ := os.Stat(filename)
if targetFileInfo.IsDir() {
err = filepath.WalkDir(filename+string(os.PathSeparator), walkFunc)
return err
}
}

if strings.HasSuffix(strings.ToUpper(fi.Name()), suffix) {
files = append(files, path.Clean(filename))
Expand Down

0 comments on commit b0684b5

Please sign in to comment.