cmd/go: restore "go list" exit code for missing binary packages

Prior to CL 108156, "go list" exited with code 0 if there were missing binary packages.
Restore that behavior to fix the failing TestBinaryOnlyPackages.

Fixes golang/go#25784.

Change-Id: Iaeca6bcc840f5ac8f2a016cef131f5c59a8261a8
Reviewed-on: https://go-review.googlesource.com/117036
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2018-06-07 12:50:21 -04:00
parent 7b08e619bb
commit 8cf579abf7
2 changed files with 3 additions and 1 deletions

View File

@ -4217,7 +4217,6 @@ func TestFatalInBenchmarkCauseNonZeroExitStatus(t *testing.T) {
}
func TestBinaryOnlyPackages(t *testing.T) {
t.Skip("known failing test; see golang.org/issue/25784")
tooSlow(t)
tg := testgo(t)

View File

@ -405,6 +405,9 @@ func (b *Builder) build(a *Action) (err error) {
}
a.Package.Stale = true
a.Package.StaleReason = "missing or invalid binary-only package"
if b.IsCmdList {
return nil
}
return fmt.Errorf("missing or invalid binary-only package")
}