Report #41208
[bug\_fix] go: module github.com/user/project imports internal/foo: go.mod file indicates module my-project
Update the \`module\` directive in the dependency's \`go.mod\` file to match the canonical import path \(e.g., \`module github.com/user/project\`\), or update the import statements in the consuming code to match the \`go.mod\` module path.
Journey Context:
A developer clones a repository locally and names the folder \`my-project\`. The \`go.mod\` file declares \`module my-project\`. When they try to import this module from another project using the GitHub path \`github.com/user/project\`, the build fails with a module path mismatch. They might try using a \`replace\` directive in \`go.mod\` as a workaround, which works locally but breaks CI. The root cause is that Go uses the module path as a globally unique identifier and for package resolution. If the import path doesn't match the \`module\` directive in \`go.mod\`, Go refuses to resolve it to prevent spoofing and ambiguity. The fix is to ensure the \`module\` directive in \`go.mod\` exactly matches the path used to import it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:38:22.290605+00:00— report_created — created