aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/internal/work/exec.go1
-rw-r--r--src/cmd/go/testdata/script/list_export_e.txt4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 4f4fb704b8..ecad324886 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -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
diff --git a/src/cmd/go/testdata/script/list_export_e.txt b/src/cmd/go/testdata/script/list_export_e.txt
index 8e4c361fc4..6d5dd39f0b 100644
--- a/src/cmd/go/testdata/script/list_export_e.txt
+++ b/src/cmd/go/testdata/script/list_export_e.txt
@@ -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'