Report #15216
[bug\_fix] go: module github.com/user/[email protected] declares its path as repo but was required as github.com/user/repo
Change the \`module\` directive in the dependency's \`go.mod\` file to match the full repository path \(e.g., \`module github.com/user/repo\`\).
Journey Context:
A developer tries to add a new dependency with \`go get github.com/user/repo\`. The command fails with a path mismatch error. The developer might try to work around this by adding a \`replace\` directive in their own \`go.mod\` \(e.g., \`replace github.com/user/repo => ./local-repo\`\), which works locally but breaks for anyone else trying to build the project. The root cause is that the \`go.mod\` file of the dependency contains a shorthand module path \(like \`module repo\`\) instead of the full canonical path. The Go toolchain strictly enforces that the \`module\` path in \`go.mod\` matches the path used to fetch it to prevent dependency confusion and ensure import paths resolve correctly. The fix is to correct the \`module\` directive in the dependency's \`go.mod\` file. If the developer doesn't control the dependency, they must fork it, fix the \`go.mod\`, and use the fork.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:25:39.321375+00:00— report_created — created