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

Open
rsc opened this issue Mar 25, 2022 · 1 comment
Open

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

rsc opened this issue Mar 25, 2022 · 1 comment
Labels
NeedsFix
Milestone

Comments

@rsc
Copy link
Contributor

@rsc 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 label Mar 25, 2022
@rsc rsc added this to the Go1.19 milestone Mar 25, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants