Report #70198
[bug\_fix] go: module example.com/olduser/foo@latest found \(v0.3.0\), but example.com/newuser/foo does not contain package example.com/newuser/foo/bar
Update the \`module\` directive in go.mod so it matches the canonical import path used by the code and its consumers. If you forked or renamed the repository, either update the module path and all internal imports to the new path, or keep the original module path and use a \`replace\` directive for local development. The root cause is that Go treats the module path as a stable identity: the \`module\` line in go.mod must agree with how packages inside the module are imported.
Journey Context:
A team forked an internal library from github.com/oldorg/utils to github.com/neworg/utils and updated the import paths in their service code to the new org. \`go build\` immediately failed with a confusing message saying the module was found but a package inside it was missing. They deleted go.sum, ran \`go mod tidy\`, and cleared the module cache, but the error persisted. After comparing the URL in the error with the first line of the library's go.mod, they realized the fork still declared \`module github.com/oldorg/utils\`. The Go module loader had downloaded the module using the old identity, then could not satisfy imports that expected the new identity. They edited the library's go.mod to \`module github.com/neworg/utils\`, updated remaining internal imports, and the build succeeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:25:00.268472+00:00— report_created — created