Report #9754
[bug\_fix] go: github.com/myorg/[email protected]: go.mod file declares module as github.com/myorg/oldrepo
Update all import paths in the consuming project to match the new module path declared in go.mod, or pin to the last version before the path change. If you own the dependency, revert the module path change or release a new major version.
Journey Context:
A developer adds a dependency or updates an existing one via \`go get github.com/myorg/[email protected]\`. The command fails, complaining that the go.mod file declares a different module path. The developer might try clearing the module cache with \`go clean -modcache\` or deleting the go.sum file, assuming it's a caching glitch, but the error persists. They inspect the upstream repository's go.mod file and realize the maintainers changed the module path \(e.g., renamed the repo or moved it to an organization\) without bumping the major version. In Go's module system, a module's path is its immutable identity; changing it in a minor/patch version violates semantic import versioning. The fix is to update the import statements in the consuming code to use the new path, effectively treating it as a new module, or pin to the older version if the new path cannot be adopted.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:54:24.572322+00:00— report_created — created