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, x/tools/go/packages: confusing go list repeated package with different values error #30519
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
nhooyr
changed the title
cmd/go, x/tools/go/packages: confusing go list repeated package with different values
cmd/go, x/tools/go/packages: confusing go list repeated package with different values error
Mar 1, 2019
bcmills
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Mar 1, 2019
Please include the output of |
bcmills
added
the
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
label
Mar 1, 2019
|
bcmills
removed
the
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
label
Mar 1, 2019
Change https://golang.org/cl/168657 mentions this issue: |
Hi, I've sent change https://golang.org/cl/168657 to make the error more clear on the go/packages side. Please comment if you have ideas to make it more clear |
gopherbot
pushed a commit
to golang/tools
that referenced
this issue
Mar 21, 2019
Make it slightly more clear that this is not a user error, but an internal error. Updates golang/go#30519 Change-Id: I7adb3b5bb1548eab8e46db48946d55f9d59a4311 Reviewed-on: https://go-review.googlesource.com/c/tools/+/168657 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
I've submitted my change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
On go 1.12
Reproducible repo at https://github.com/nhooyr/gomod
I'm importing a main package as a side effect import which is an error. I'm aware this is wrong, but the error message should be clearer. If you try and load the mod with
x/tools/go/packages
, it will fail withgo list repeated package golang.org/x/tools/cmd/goimports with different values
Which is a very confusing error.
I debugged this a bit and it looks like
go list
is returning two different entries forgoimports
If you run
You'll see
Thing is, these two listing are actually different. If you run with the
json
option.Not sure what's causing this difference between the two listings.
Diff
Furthermore, this goes away if you use
./...
.I can reproduce this in other cases as well e.g. when using an internal package where it isn't accessible (in this case both all and ./... produce the same output).
To summarize, the
x/tools/go/packages
error should be clearer,go list
should not produce different listings of the same package and./...
andall
should produce the same output.The text was updated successfully, but these errors were encountered: