cmd/go: list flag -json negates the -f flag #44738
Labels
FrozenDueToAge
GoCommand
cmd/go
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
When writing scripts, my workflow is usually:
go list -json
query to find the fields/info I need-f
, so I can then get the field I need directly-f
formSometimes, because I'm forgetful, I'll do step 2 as
go list -json -f {{.Field}}
without removing-json
. That happened today again, and I was really confused for a solid five minutes:If both flags are present, I would expect one of the following:
-f
flag would mean ignoring the-json
flag, as it's more specificI think the first option makes more sense. Silently ignoring the
-f
flag seems like the worst option to me.The text was updated successfully, but these errors were encountered: