-
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: mod -sync should trim go.sum #26381
Comments
Files in go.sum are never intended to be removed. It keeps a list of all modules seen. |
That approach (if indeed the defined behaviour) is (1) badly documented, (2) probably wouldn't scale very well, (3) raises questions. Regarding (1) here is what
I added the emphasis. My assumptions from reading this section are:
By (2) I mean that when we consider a project like Hugo, with hundreds of dependencies being added, removed, and updated daily in several branches. By (3) I simply mean that the "Go 1.11 Modules Experiment" comes with a number of tools to support modules in a project. So why not include a tool to maintain |
I'd like to get @FiloSottile's input on what we should do here. On the one hand, the more we leave in the |
I appreciate the fact that One way to look at this is that For projects so big it becomes a problem, there can be an external tool to trim |
The current "add only" behavior (the file is sorted so it's not exactly "append-only") was intended. I think that was more defensible when it was opt-in. Now that it's a required part of development (at @FiloSottile's urging), I do think we owe it to ourselves to make it a bit nicer, and that probably does include throwing away things that are no longer needed. Right now there's too much path dependence: if you go get something, decide not to use it, and drop it, ideally you would be back where you started and instead there's scar tissue left in I think you're right that |
Change https://golang.org/cl/124713 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What did you do?
What did you expect to see?
Nothing.
What did you see instead?
The text was updated successfully, but these errors were encountered: