Skip to content

Commit 1f31820

Browse files
committed
util: replace Walk with WalkDir
Closes: #25163 Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent eea2866 commit 1f31820

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/podman/common/completion.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package common
33
import (
44
"bufio"
55
"fmt"
6+
"io/fs"
67
"os"
78
"path"
89
"path/filepath"
@@ -1646,8 +1647,8 @@ func AutocompleteContainersConfModules(cmd *cobra.Command, args []string, toComp
16461647
for _, d := range dirs {
16471648
cleanedD := filepath.Clean(d)
16481649
moduleD := cleanedD + string(os.PathSeparator)
1649-
_ = filepath.Walk(d,
1650-
func(path string, f os.FileInfo, err error) error {
1650+
_ = filepath.WalkDir(d,
1651+
func(path string, d fs.DirEntry, err error) error {
16511652
if err != nil {
16521653
return err
16531654
}
@@ -1657,7 +1658,7 @@ func AutocompleteContainersConfModules(cmd *cobra.Command, args []string, toComp
16571658
return nil
16581659
}
16591660

1660-
if filepath.Clean(path) == cleanedD || f.IsDir() {
1661+
if filepath.Clean(path) == cleanedD || d.IsDir() {
16611662
return nil
16621663
}
16631664

0 commit comments

Comments
 (0)