Skip to content

Commit f0abee6

Browse files
Reinhard Tartleranthonyfok
Reinhard Tartler
authored andcommitted
Tolerate "errornous" packages in go list
Fixes: #204
1 parent 989837a commit f0abee6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

make.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (u *upstream) tar(gopath, repo string) error {
215215
// findMains finds main packages within the repo (useful to auto-detect the
216216
// package type).
217217
func (u *upstream) findMains(gopath, repo string) error {
218-
cmd := exec.Command("go", "list", "-f", "{{.ImportPath}} {{.Name}}", repo+"/...")
218+
cmd := exec.Command("go", "list", "-e", "-f", "{{.ImportPath}} {{.Name}}", repo+"/...")
219219
cmd.Stderr = os.Stderr
220220
cmd.Env = append([]string{
221221
"GO111MODULE=off",
@@ -226,7 +226,7 @@ func (u *upstream) findMains(gopath, repo string) error {
226226
if err != nil {
227227
log.Println("WARNING: In findMains:", fmt.Errorf("%q: %w", cmd.Args, err))
228228
log.Printf("Retrying without appending \"/...\" to repo")
229-
cmd = exec.Command("go", "list", "-f", "{{.ImportPath}} {{.Name}}", repo)
229+
cmd = exec.Command("go", "list", "-e", "-f", "{{.ImportPath}} {{.Name}}", repo)
230230
cmd.Stderr = os.Stderr
231231
cmd.Env = append([]string{
232232
"GO111MODULE=off",
@@ -256,7 +256,7 @@ func (u *upstream) findMains(gopath, repo string) error {
256256
func (u *upstream) findDependencies(gopath, repo string) error {
257257
log.Printf("Determining dependencies\n")
258258

259-
cmd := exec.Command("go", "list", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo+"/...")
259+
cmd := exec.Command("go", "list", "-e", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo+"/...")
260260
cmd.Stderr = os.Stderr
261261
cmd.Env = append([]string{
262262
"GO111MODULE=off",
@@ -267,7 +267,7 @@ func (u *upstream) findDependencies(gopath, repo string) error {
267267
if err != nil {
268268
log.Println("WARNING: In findDependencies:", fmt.Errorf("%q: %w", cmd.Args, err))
269269
log.Printf("Retrying without appending \"/...\" to repo")
270-
cmd = exec.Command("go", "list", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo)
270+
cmd = exec.Command("go", "list", "-e", "-f", "{{join .Imports \"\\n\"}}\n{{join .TestImports \"\\n\"}}\n{{join .XTestImports \"\\n\"}}", repo)
271271
cmd.Stderr = os.Stderr
272272
cmd.Env = append([]string{
273273
"GO111MODULE=off",

0 commit comments

Comments
 (0)