Join GitHub today
GitHub is home to over 31 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