-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: go mod tidy does not always remove unneeded entries #33008
Comments
Yeah, the whole abstraction around the go/src/cmd/go/internal/modfetch/fetch.go Lines 584 to 585 in 06ef108
|
It looks like in this particular case, the entry for
The go command loads the I think this is working as intended, but we should document it better. |
We should fix this, but it's lower priority than a lot of other bugs. |
In particular,
|
Yes, that entry is necessary, but there is a bug here, as @bcmills reiterates, which is that the non-go.mod line is still there and shouldn't be. In general, AIUI, the |
Perhaps you could elaborate on the subject a bit more? Thank you in advance. |
@av86743, the Following the advice of Parnas '72, which I believe to be generally sound, the |
Any intentions (or perhaps an open CL) to refactor |
@av86743, I had a CL started for the 1.13 cycle but missed the freeze. I may dust it off for 1.14. Mostly it moved a bunch of functions from |
Change https://golang.org/cl/237017 mentions this issue: |
Change https://golang.org/cl/262781 mentions this issue: |
Previously, we would retain entries in go.sum for .mod files in the module graph (reachable from the main module) and for .zip files of modules providing packages. This isn't quite enough: when we load a package, we need the content of each module in the build list that *could* provide the package (that is, each module whose path is a prefix of the package's path) so we can diagnose ambiguous imports. For #33008 Change-Id: I0b4d9d68c1f4ca382f0983a3a7e537764f35c3aa Reviewed-on: https://go-review.googlesource.com/c/go/+/262781 Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Trust: Jay Conrod <[email protected]>
There was an unnecessary entry in a
go.sum
file that wasn't being removed bygo mod tidy
.Here's a testscript script that reproduces the issue:
The text was updated successfully, but these errors were encountered: