aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/search/search.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/internal/search/search.go')
-rw-r--r--src/cmd/go/internal/search/search.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/go/internal/search/search.go b/src/cmd/go/internal/search/search.go
index 4efef24152..57cbb282a8 100644
--- a/src/cmd/go/internal/search/search.go
+++ b/src/cmd/go/internal/search/search.go
@@ -7,8 +7,10 @@ package search
import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
+ "cmd/go/internal/fsys"
"fmt"
"go/build"
+ "io/fs"
"os"
"path"
"path/filepath"
@@ -127,7 +129,7 @@ func (m *Match) MatchPackages() {
if m.pattern == "cmd" {
root += "cmd" + string(filepath.Separator)
}
- err := filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
+ err := fsys.Walk(root, func(path string, fi fs.FileInfo, err error) error {
if err != nil {
return err // Likely a permission error, which could interfere with matching.
}
@@ -153,8 +155,8 @@ func (m *Match) MatchPackages() {
}
if !fi.IsDir() {
- if fi.Mode()&os.ModeSymlink != 0 && want {
- if target, err := os.Stat(path); err == nil && target.IsDir() {
+ if fi.Mode()&fs.ModeSymlink != 0 && want {
+ if target, err := fsys.Stat(path); err == nil && target.IsDir() {
fmt.Fprintf(os.Stderr, "warning: ignoring symlink %s\n", path)
}
}
@@ -263,7 +265,7 @@ func (m *Match) MatchDirs() {
}
}
- err := filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
+ err := fsys.Walk(dir, func(path string, fi fs.FileInfo, err error) error {
if err != nil {
return err // Likely a permission error, which could interfere with matching.
}
@@ -272,7 +274,7 @@ func (m *Match) MatchDirs() {
}
top := false
if path == dir {
- // filepath.Walk starts at dir and recurses. For the recursive case,
+ // Walk starts at dir and recurses. For the recursive case,
// the path is the result of filepath.Join, which calls filepath.Clean.
// The initial case is not Cleaned, though, so we do this explicitly.
//