From 604b18aa7426148a55f76307ca729e829ff6b61d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 29 Jul 2019 09:22:22 +0200 Subject: [PATCH] build: Fix building in ~/go Before, build.go only unset GO111MODULE and GOPATH, so the Go compiler did not see either and worked in Module mode. But if the code is checked out below ~/go (the default GOPATH), it will detect that the source is within GOPATH and switch to non-Module mode. Now we're setting GO111MODULE to "on" explicitly. --- build.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.go b/build.go index 2e3e5d05f..0b3a6a61a 100644 --- a/build.go +++ b/build.go @@ -575,6 +575,9 @@ func main() { buildArgs = append(buildArgs, "-mod=vendor") testArgs = append(testArgs, "-mod=vendor") + + goEnv["GO111MODULE"] = "on" + buildEnv["GO111MODULE"] = "on" } else { if tempdir == "" { tempdir, err = ioutil.TempDir("", fmt.Sprintf("%v-build-", config.Name))