Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go, x/tools/go/packages: confusing go list repeated package with different values error #30519
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
Which is a very confusing error.
I debugged this a bit and it looks like
If you run
Thing is, these two listing are actually different. If you run with the
Not sure what's causing this difference between the two listings.
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
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 <firstname.lastname@example.org> Reviewed-by: Ian Cottrell <email@example.com>