Report #24955
[bug\_fix] go: updates to go.sum needed, but module was loaded with -mod=readonly \(or missing go.sum entry in CI\)
Run \`go mod tidy\` locally, commit the updated \`go.sum\` file, and push the change to version control.
Journey Context:
A developer adds a new dependency import to their code and pushes it to their CI pipeline. The CI build suddenly fails with a missing go.sum entry or -mod=readonly error. The developer is confused because the code compiled perfectly on their local machine. They check their local go.sum and realize it was automatically updated by their IDE or a local \`go run\`, but they forgot to stage and commit the updated go.sum file. The CI pipeline uses GOFLAGS=-mod=readonly \(or Go 1.16\+ default behavior\) to prevent undeclared dependencies from sneaking into the build, which strictly forbids modifying go.sum on the fly. Running \`go mod tidy\` synchronizes the go.sum with go.mod, and committing it ensures CI has the necessary cryptographic hashes to verify the dependencies before building.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:17:39.825323+00:00— report_created — created