Report #2833
[bug\_fix] go: found module X but does not contain package Y
Update the import path to include the major version suffix declared in the dependency's go.mod \(e.g., change 'github.com/foo/bar/baz' to 'github.com/foo/bar/v2/baz'\).
Journey Context:
A developer adds a new dependency and imports one of its sub-packages using the path they see in the GitHub repository. When they run 'go build', it fails with this error. They are confused because the directory clearly exists on GitHub. Inspecting the dependency's go.mod file, they notice the module directive is 'module github.com/foo/bar/v2'. Go requires the import path to match the module path exactly, including the major version suffix for v2\+ modules. Updating the import path to append '/v2' resolves the build failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T14:19:58.547624+00:00— report_created — created