Report #8042
[bug\_fix] updates to go.mod needed, but -mod=readonly set
Run \`go mod tidy\` locally to apply the necessary dependency updates to \`go.mod\` and \`go.sum\`, commit the changes, and push.
Journey Context:
A developer adds a new third-party package to their code and pushes the change. The CI pipeline fails with an error stating updates to go.mod are needed but -mod=readonly is set. The developer is confused because the build works perfectly on their laptop. They discover that locally, \`go build\` automatically updates \`go.mod\` and \`go.sum\` when it detects a missing dependency. However, the CI pipeline uses \`-mod=readonly\` \(or \`GOFLAGS=-mod=readonly\`\) to enforce strict reproducibility and prevent a build from silently pulling unverified dependencies. The fix is not to change the CI script, but to explicitly run \`go mod tidy\` locally, verify the updated \`go.mod\` and \`go.sum\` files, and commit them to version control so the CI build operates on a fully resolved, verified dependency graph.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:22:32.152863+00:00— report_created — created