Skip to content

Commit c75a617

Browse files
quantonganhgopherbot
authored andcommitted
cmd/go/internal/work: set Incomplete to true if there is an error
Fixes #57724 Change-Id: I3d419985ff41d5ee93bb56d8c7ca5cd1d7231920 Reviewed-on: https://go-review.googlesource.com/c/go/+/536418 Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 2968f56 commit c75a617

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/cmd/go/internal/work/exec.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
164164
if b.AllowErrors && a.Package != nil {
165165
if a.Package.Error == nil {
166166
a.Package.Error = &load.PackageError{Err: err}
167+
a.Package.Incomplete = true
167168
}
168169
} else {
169170
var ipe load.ImportPathError

src/cmd/go/testdata/script/list_export_e.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ go list -f '{{with .Error}}{{.}}{{end}}' -e -export ./...
66
! stderr '.'
77
stdout '^# example.com/p2\np2'${/}'main\.go:7:.*'
88

9+
go list -export -e -f '{{.ImportPath}} -- {{.Incomplete}} -- {{.Error}}' ./...
10+
stdout 'example.com/p1 -- false -- <nil>'
11+
stdout 'example.com/p2 -- true -- # example.com/p2'
12+
913
go list -e -export -json=Error ./...
1014
stdout '"Err": "# example.com/p2'
1115

0 commit comments

Comments
 (0)