Report #9160
[bug\_fix] module ...: go.mod file specifies module path ... but import path is ...
Add the major version suffix \(e.g., /v2\) to the module directive in go.mod, and update all import paths within the module to include the /v2 suffix.
Journey Context:
A developer refactors a library to version 2.0.0 and pushes a git tag v2.0.0. They update the go.mod file to say module github.com/example/mylib and the version to v2.0.0. Consumers trying to import it via import 'github.com/example/mylib/v2' get an error, or if they import without /v2 they get v1. The Go module system requires that modules with major versions >= 2 must include the major version in the module path. The developer spends hours checking git tags and go.mod versions, only to realize the module path itself must change. Adding /v2 to the module directive in go.mod and updating all internal imports fixes it because Go treats different major versions as entirely different modules.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:23:39.520241+00:00— report_created — created