aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-02-28 16:47:17 -0500
committerBryan C. Mills <bcmills@google.com>2019-03-01 16:27:27 +0000
commit4e10ce45f5ea4f1328876c0defd7d8c8150fc397 (patch)
treedcee33279970edf06ba60e14fa4edbed1d92d665
parent4f4c2a79d4f952b96d58aec2926b4c894245071b (diff)
downloadgo-4e10ce45f5ea4f1328876c0defd7d8c8150fc397.tar.xz
go/build: set GO111MODULE=off explicitly in TestImportVendor*
These tests check for GOPATH-mode vendoring behavior, so make sure they're in GOPATH mode. Updates #30228 Change-Id: I646f59b67cb76dacd07adc3f6ed15ed63f4e22a4 Reviewed-on: https://go-review.googlesource.com/c/164620 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-rw-r--r--src/go/build/build_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/go/build/build_test.go b/src/go/build/build_test.go
index db8b12eabf..cfcb8167a1 100644
--- a/src/go/build/build_test.go
+++ b/src/go/build/build_test.go
@@ -350,6 +350,10 @@ func TestImportDirNotExist(t *testing.T) {
func TestImportVendor(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source
+
+ defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+ os.Setenv("GO111MODULE", "off")
+
ctxt := Default
wd, err := os.Getwd()
if err != nil {
@@ -368,6 +372,10 @@ func TestImportVendor(t *testing.T) {
func TestImportVendorFailure(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source
+
+ defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+ os.Setenv("GO111MODULE", "off")
+
ctxt := Default
wd, err := os.Getwd()
if err != nil {
@@ -387,6 +395,10 @@ func TestImportVendorFailure(t *testing.T) {
func TestImportVendorParentFailure(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source
+
+ defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+ os.Setenv("GO111MODULE", "off")
+
ctxt := Default
wd, err := os.Getwd()
if err != nil {