Skip to content

Commit

Permalink
Merge pull request #25164 from giuseppe/replace-walk
Browse files Browse the repository at this point in the history
util: replace Walk with WalkDir
  • Loading branch information
openshift-merge-bot[bot] authored Jan 30, 2025
2 parents 787da60 + 1f31820 commit be5d807
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/podman/common/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package common
import (
"bufio"
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -1646,8 +1647,8 @@ func AutocompleteContainersConfModules(cmd *cobra.Command, args []string, toComp
for _, d := range dirs {
cleanedD := filepath.Clean(d)
moduleD := cleanedD + string(os.PathSeparator)
_ = filepath.Walk(d,
func(path string, f os.FileInfo, err error) error {
_ = filepath.WalkDir(d,
func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand All @@ -1657,7 +1658,7 @@ func AutocompleteContainersConfModules(cmd *cobra.Command, args []string, toComp
return nil
}

if filepath.Clean(path) == cleanedD || f.IsDir() {
if filepath.Clean(path) == cleanedD || d.IsDir() {
return nil
}

Expand Down

0 comments on commit be5d807

Please sign in to comment.