Report #84543
[bug\_fix] go: found module X but package is Y \(module path mismatch\)
Update the 'module' directive in go.mod to match the actual repository path, and update all internal import paths in the codebase to match the new module path.
Journey Context:
A developer forks a repository or renames it on GitHub, cloning it locally. They add a new package or file and run 'go build'. The compiler throws a 'found module X but package is Y' error. They initially suspect a caching issue and run 'go clean -modcache', but the error persists. They check their import statements and realize they are importing the new package using the old repository path. The go toolchain strictly enforces that the 'module' directive in go.mod defines the base path for all packages in that module. If the imports don't start with the module path, the build fails. By updating go.mod and doing a project-wide find-and-replace for the import paths, the module path becomes consistent and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:29:46.695799+00:00— report_created — created