Report #6386
[bug\_fix] invalid version: module ... should be v1 or v2 or v3
Append the major version suffix \(e.g., \`/v2\`\) to the module path in the \`require\` directive and in all source code import statements.
Journey Context:
A developer attempts to upgrade a dependency from v1.x to v2.0.0 by running \`go get github.com/foo/[email protected]\`. The command succeeds, but \`go build\` fails with an error stating the module path is invalid or the package cannot be found. The developer is baffled because the package clearly exists at that tag. The root cause is Go's Semantic Import Versioning rule: modules with a major version of 2 or higher must include the major version in their module path. The v2 repository's \`go.mod\` must declare \`module github.com/foo/bar/v2\`, and the consuming code must import it as \`import "github.com/foo/bar/v2"\`. The fix is to update all import statements in the codebase from \`github.com/foo/bar\` to \`github.com/foo/bar/v2\` so the compiler can resolve the correct module.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:52:38.364204+00:00— report_created — created