summaryrefslogtreecommitdiffstats
path: root/src/cmd/go/testdata/script/mod_symlink.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 13:16:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 13:16:40 +0000
commit47ab3d4a42e9ab51c465c4322d2ec233f6324e6b (patch)
treea61a0ffd83f4a3def4b36e5c8e99630c559aa723 /src/cmd/go/testdata/script/mod_symlink.txt
parentInitial commit. (diff)
downloadgolang-1.18-47ab3d4a42e9ab51c465c4322d2ec233f6324e6b.tar.xz
golang-1.18-47ab3d4a42e9ab51c465c4322d2ec233f6324e6b.zip
Adding upstream version 1.18.10.upstream/1.18.10upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cmd/go/testdata/script/mod_symlink.txt')
-rw-r--r--src/cmd/go/testdata/script/mod_symlink.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/mod_symlink.txt b/src/cmd/go/testdata/script/mod_symlink.txt
new file mode 100644
index 0000000..0604e1a
--- /dev/null
+++ b/src/cmd/go/testdata/script/mod_symlink.txt
@@ -0,0 +1,45 @@
+env GO111MODULE=on
+[!symlink] skip
+
+# 'go get' should resolve modules of imported packages.
+go get
+go list -deps -f '{{.Module}}' .
+stdout golang.org/x/text
+
+go get ./subpkg
+go list -deps -f '{{.Module}}' ./subpkg
+stdout golang.org/x/text
+
+# Create a copy of the module using symlinks in src/links.
+mkdir links
+symlink links/go.mod -> $GOPATH/src/go.mod
+symlink links/go.sum -> $GOPATH/src/go.sum
+symlink links/issue.go -> $GOPATH/src/issue.go
+mkdir links/subpkg
+symlink links/subpkg/issue.go -> $GOPATH/src/subpkg/issue.go
+
+# We should see the copy as a valid module root.
+cd links
+go env GOMOD
+stdout links[/\\]go.mod
+go list -m
+stdout golang.org/issue/28107
+
+# The symlink-based copy should contain the same packages
+# and have the same dependencies as the original.
+go list -deps -f '{{.Module}}' .
+stdout golang.org/x/text
+go list -deps -f '{{.Module}}' ./subpkg
+stdout golang.org/x/text
+
+-- go.mod --
+module golang.org/issue/28107
+
+-- issue.go --
+package issue
+
+import _ "golang.org/x/text/language"
+-- subpkg/issue.go --
+package issue
+
+import _ "golang.org/x/text/language"