Skip to content

cmd/dist: test -json emits some non-JSON lines for packages without tests #76024

Description

@dmitshur

When the -json flag is used with go tool dist test (added in #37486), it's expected to only write JSON lines.

There seems to be a path where some non-JSON is written to stdout too, which is a bug:

$ go tool dist test -json -run=crypto/...:gofips140
{"Time":"2025-10-23T12:36:35.439236-04:00","Action":"start","Package":"crypto:gofips140"}
{"Time":"2025-10-23T12:36:35.443492-04:00","Action":"start","Package":"crypto/aes:gofips140"}
{"Time":"2025-10-23T12:36:35.445535-04:00","Action":"start","Package":"crypto/cipher:gofips140"}
[...]
?       crypto/internal/boring/bbig    [no test files]
?       crypto/internal/boring/sig    [no test files]
?       crypto/internal/cryptotest    [no test files]
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions