aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/test_vendor.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/testdata/script/test_vendor.txt')
-rw-r--r--src/cmd/go/testdata/script/test_vendor.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/go/testdata/script/test_vendor.txt b/src/cmd/go/testdata/script/test_vendor.txt
index d72d672827..c6a88b6fed 100644
--- a/src/cmd/go/testdata/script/test_vendor.txt
+++ b/src/cmd/go/testdata/script/test_vendor.txt
@@ -1,9 +1,19 @@
-# Test
+# In GOPATH mode, vendored packages can replace std packages.
+env GO111MODULE=off
cd vend/hello
go test -v
stdout TestMsgInternal
stdout TestMsgExternal
+# In module mode, they cannot.
+env GO111MODULE=on
+! go test -mod=vendor
+stderr 'undefined: strings.Msg'
+
+-- vend/hello/go.mod --
+module vend/hello
+
+go 1.16
-- vend/hello/hello.go --
package main