Skip to content

Commit

Permalink
repalcing deprecated readdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe da Veiga Leprevost committed May 27, 2022
1 parent 7794b93 commit 4dc0774
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/uti/uti.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,14 @@ func IOReadDir(root, ext string) []string {

var files []string

fileInfo, err := os.ReadDir(root)
fileInfo, err := os.Open(root)
if err != nil {
return files
}
for _, file := range fileInfo {

fileList, _ := fileInfo.Readdir(0)

for _, file := range fileList {
if strings.Contains(file.Name(), ext) {
files = append(files, filepath.Join(root, file.Name()))
}
Expand Down

0 comments on commit 4dc0774

Please sign in to comment.