aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Mills <bcmills@google.com>2022-01-22 03:42:40 +0000
committerBryan Mills <bcmills@google.com>2022-01-24 12:26:25 +0000
commit0ef6dd74409506eb084bd8d2fe61e0e70ed9e5a4 (patch)
tree363b095f881271edc9d7485a10b9241420b8dded /src
parentb7fa0f941f05fdf8420f15cd5ebe2f209da172e0 (diff)
downloadgo-0ef6dd74409506eb084bd8d2fe61e0e70ed9e5a4.tar.xz
Revert "cmd/go: evaluate root symlink in matchPackages"
This reverts CL 380057. Reason for revert: appears to have broken x/tools tests on macOS. Change-Id: If1340bcb9b78f7271798c4dd923553e33db7f72e Reviewed-on: https://go-review.googlesource.com/c/go/+/380294 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/internal/modload/search.go5
-rw-r--r--src/cmd/go/testdata/script/work_root_is_symlink.txt20
2 files changed, 0 insertions, 25 deletions
diff --git a/src/cmd/go/internal/modload/search.go b/src/cmd/go/internal/modload/search.go
index 771968d023..799c48e50a 100644
--- a/src/cmd/go/internal/modload/search.go
+++ b/src/cmd/go/internal/modload/search.go
@@ -54,11 +54,6 @@ func matchPackages(ctx context.Context, m *search.Match, tags map[string]bool, f
)
walkPkgs := func(root, importPathRoot string, prune pruning) {
- // Follow root if it's a symlink so path == root comparisons don't
- // spuriously fail when root is a symlink and it points to path.
- if r, err := filepath.EvalSymlinks(root); err == nil {
- root = r
- }
root = filepath.Clean(root)
err := fsys.Walk(root, func(path string, fi fs.FileInfo, err error) error {
if err != nil {
diff --git a/src/cmd/go/testdata/script/work_root_is_symlink.txt b/src/cmd/go/testdata/script/work_root_is_symlink.txt
deleted file mode 100644
index a1c0b46b67..0000000000
--- a/src/cmd/go/testdata/script/work_root_is_symlink.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# Test that cmd/go follows the symlink and properly determines
-# the module boundary when the working directory is a symlink.
-
-[!symlink] skip
-
-symlink worksym -> workspace
-cd worksym
-go list all
-stdout example.com/workspace
-
--- workspace/go.work --
-go 1.18
-
-use .
--- workspace/go.mod --
-module example.com/workspace
-
-go 1.18
--- workspace/pkg.go --
-package workspace \ No newline at end of file