Skip to content

Commit 8efb8c6

Browse files
committed
Set GO111MODULE=off when calling "go list" etc.
to keep dh-make-golang make and estimate working with Go 1.16 and 1.17
1 parent b847780 commit 8efb8c6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

estimate.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func get(gopath, repo string) error {
3131
cmd := exec.Command("go", "get", "-d", "-t", repo+"/...")
3232
cmd.Stderr = os.Stderr
3333
cmd.Env = append([]string{
34-
fmt.Sprintf("GOPATH=%s", gopath),
34+
"GO111MODULE=off",
35+
"GOPATH=" + gopath,
3536
}, passthroughEnv()...)
3637
return cmd.Run()
3738
}
@@ -84,7 +85,8 @@ func estimate(importpath string) error {
8485
cmd := exec.Command("go", "list", "std")
8586
cmd.Stderr = os.Stderr
8687
cmd.Env = append([]string{
87-
fmt.Sprintf("GOPATH=%s", gopath),
88+
"GO111MODULE=off",
89+
"GOPATH=" + gopath,
8890
}, passthroughEnv()...)
8991

9092
out, err := cmd.Output()

make.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ func (u *upstream) findMains(gopath, repo string) error {
215215
cmd := exec.Command("go", "list", "-f", "{{.ImportPath}} {{.Name}}", repo+"/...")
216216
cmd.Stderr = os.Stderr
217217
cmd.Env = append([]string{
218-
fmt.Sprintf("GOPATH=%s", gopath),
218+
"GO111MODULE=off",
219+
"GOPATH=" + gopath,
219220
}, passthroughEnv()...)
220221
out, err := cmd.Output()
221222
if err != nil {
@@ -243,7 +244,8 @@ func (u *upstream) findDependencies(gopath, repo string) error {
243244
cmd := exec.Command("go", "list", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo+"/...")
244245
cmd.Stderr = os.Stderr
245246
cmd.Env = append([]string{
246-
fmt.Sprintf("GOPATH=%s", gopath),
247+
"GO111MODULE=off",
248+
"GOPATH=" + gopath,
247249
}, passthroughEnv()...)
248250

249251
out, err := cmd.Output()
@@ -276,7 +278,8 @@ func (u *upstream) findDependencies(gopath, repo string) error {
276278
cmd.Dir = filepath.Join(gopath, "src", repo)
277279
cmd.Stderr = os.Stderr
278280
cmd.Env = append([]string{
279-
fmt.Sprintf("GOPATH=%s", gopath),
281+
// Not affected by GO111MODULE
282+
"GOPATH=" + gopath,
280283
}, passthroughEnv()...)
281284

282285
out, err = cmd.Output()

0 commit comments

Comments
 (0)