Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: reject list -export -find more clearly #51952

Closed
rsc opened this issue Mar 25, 2022 · 3 comments
Closed

cmd/go: reject list -export -find more clearly #51952

rsc opened this issue Mar 25, 2022 · 3 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Mar 25, 2022

cmd/go/internal/list/list.go says

// These pairings make no sense.
if *listFind && *listDeps {
	base.Fatalf("go list -deps cannot be used with -find")
}
if *listFind && *listTest {
	base.Fatalf("go list -test cannot be used with -find")
}

but the same is true of *listExports.

% go list -export -f '{{.Export}}' strconv
/Users/rsc/go/pkg/darwin_amd64/strconv.a
% go list -export -find -f '{{.Export}}' strconv
# strconv
../../strconv/atof.go:13:8: could not import math (open : no such file or directory)
../../strconv/atoi.go:7:8: could not import errors (open : no such file or directory)
../../strconv/bytealg.go:10:8: could not import internal/bytealg (open : no such file or directory)
../../strconv/eisel_lemire.go:22:2: could not import math/bits (open : no such file or directory)
../../strconv/quote.go:10:2: could not import unicode/utf8 (open : no such file or directory)
% 

This should probably be fixed in cmd/go and possibly also in the docs, which say nothing about -find being incompatible with other flags.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 25, 2022
@rsc rsc added this to the Go1.19 milestone Mar 25, 2022
@gopherbot
Copy link

Change https://go.dev/cl/396074 mentions this issue: internal/cmd: update to reject list when -find and -export are specified

@ianlancetaylor
Copy link
Contributor

@bcmills @matloob This issue is marked for 1.19. It's just been rolling forward in milestones. Should it move to Backlog? Thanks.

@bcmills
Copy link
Member

bcmills commented Jun 28, 2022

Looks like a contributor sent a fix CL that we missed. I've reviewed it (it's small, self-contained, and low-risk), so I think this can indeed make Go 1.19.

@gopherbot gopherbot modified the milestones: Go1.19, Go1.20 Aug 2, 2022
@gopherbot gopherbot modified the milestones: Go1.20, Go1.21 Feb 1, 2023
@dmitshur dmitshur added the GoCommand cmd/go label Feb 27, 2023
@golang golang locked and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

5 participants