mirror of
https://github.com/golang/go
synced 2024-11-26 23:51:29 -07:00
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 <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
parent
2968f5623c
commit
c75a617af0
@ -164,6 +164,7 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
|
||||
if b.AllowErrors && a.Package != nil {
|
||||
if a.Package.Error == nil {
|
||||
a.Package.Error = &load.PackageError{Err: err}
|
||||
a.Package.Incomplete = true
|
||||
}
|
||||
} else {
|
||||
var ipe load.ImportPathError
|
||||
|
4
src/cmd/go/testdata/script/list_export_e.txt
vendored
4
src/cmd/go/testdata/script/list_export_e.txt
vendored
@ -6,6 +6,10 @@ go list -f '{{with .Error}}{{.}}{{end}}' -e -export ./...
|
||||
! stderr '.'
|
||||
stdout '^# example.com/p2\np2'${/}'main\.go:7:.*'
|
||||
|
||||
go list -export -e -f '{{.ImportPath}} -- {{.Incomplete}} -- {{.Error}}' ./...
|
||||
stdout 'example.com/p1 -- false -- <nil>'
|
||||
stdout 'example.com/p2 -- true -- # example.com/p2'
|
||||
|
||||
go list -e -export -json=Error ./...
|
||||
stdout '"Err": "# example.com/p2'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user