mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 04:45:15 +00:00
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
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 New Issue
Block a user