Report #35882
[bug\_fix] go: updates to go.sum needed, disabled by -mod=readonly
Run \`go mod tidy\` locally, commit the updated \`go.mod\` and \`go.sum\`, and push again. Do not use \`-mod=mod\` in CI.
Journey Context:
A developer adds a new third-party package to their project and runs \`go test\`, which passes. They commit their code but forget to commit the updated \`go.mod\` and \`go.sum\`. The CI pipeline runs \`go test\` and fails with 'updates to go.sum needed, disabled by -mod=readonly'. The developer might try to fix this by adding \`GOFLAGS=-mod=mod\` to their CI environment variables to bypass the error. While this makes CI pass, it introduces non-deterministic builds because CI is now silently downloading and updating dependencies. The root cause is that Go 1.16\+ changed the default behavior of \`go build\` and \`go test\` to run in \`-mod=readonly\` mode when a \`go.sum\` file exists, preventing implicit updates. The proper fix is to remove the CI bypass, run \`go mod tidy\` locally to explicitly update the dependency manifests, and commit the updated \`go.mod\` and \`go.sum\` files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:42:13.964527+00:00— report_created — created