Skip to content

cmd/go: consider erroring if go list -f requests a field that can't be available #51638

@mvdan

Description

@mvdan
go version devel go1.19-c1f22134f2 Fri Mar 11 06:03:26 2022 +0000 linux/amd64

I just spent a couple of minutes wondering why this printed nothing:

go list -f {{.BuildID}}

I was of course forgetting the -export flag, which fills fields like BuildID.

Instead of silently using the field that will always be unset, it would be nice if cmd/go failed with an obvious message, like: did you forget to set the -export flag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions