forked from TrueCloudLab/restic
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:
parent
01c51b3449
commit
604b18aa74
1 changed files with 3 additions and 0 deletions
3
build.go
3
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))
|
||||
|
|
Loading…
Reference in a new issue