From 521605a96eeb71ae751d7b041ee9b8575ec1567e Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Mon, 8 Jul 2019 13:52:33 -0400 Subject: [PATCH] Set GO111MODULE=off in GoStdLib action This is a partial cherry-pick of #2090 for release branches only. Fixes #1987 --- go/tools/builders/stdlib.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/tools/builders/stdlib.go b/go/tools/builders/stdlib.go index e7f0d07c8e..b5e3fa0194 100644 --- a/go/tools/builders/stdlib.go +++ b/go/tools/builders/stdlib.go @@ -57,6 +57,11 @@ func stdlib(args []string) error { // Now switch to the newly created GOROOT os.Setenv("GOROOT", output) + // Disable modules for the 'go install' command. Depending on the sandboxing + // mode, there may be a go.mod file in a parent directory which will turn + // modules on in "auto" mode. + os.Setenv("GO111MODULE", "off") + // Create a temporary cache directory. "go build" requires this starting // in Go 1.12. cachePath := filepath.Join(output, ".gocache")