-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go test ./... or go build should not update existing dependencies and only add new dependencies as needed to satisfy imports #37780
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
Comments
Build commands like If you don't see any new requirement being added, it's possible that your Could you confirm one of these situations is what's happening? If not, could you post a small reproducible example? Also, if you don't want dependencies to be updated in either situation, have you tried using the |
I have not looked at the dependency and transitive dependency versions into much detail because we have a lot of them. I am not sure if there's a way to run go commands in debug or verbose mode to try to figure out why it's insisting on updating dependencies so we can look into that.
We tried that but the builds on our CI failed due to this error But my question is that is there a way to make go services build with existing set of dependencies in the go.mod and go.sum files without running |
If a build is adding or updating dependencies, that means |
Gotcha. I guess we will have to run |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Running
go test ./...
orgo build
on our CI systems tries to update the go.mod and go.sum. When I tried running go mod tidy it updated 2 existing dependencies in the go.mod:It also adds lines in go.sum for the new packages
What did you expect to see?
Make sure all imports are satisfied by existing dependencies present in the go.mod, go.sum
What did you see instead?
Tries to update existing dependencies
The text was updated successfully, but these errors were encountered: