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.
This commit is contained in:
Alexander Neumann 2019-07-29 09:22:22 +02:00
parent 01c51b3449
commit 604b18aa74
1 changed files with 3 additions and 0 deletions

View File

@ -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))