Report #40300
[bug\_fix] go: module ... found, but does not contain package ...
Ensure the import path exactly matches the module path in the dependency's go.mod, paying special attention to the major version suffix \(e.g., /v2\).
Journey Context:
A developer updates a dependency to a new major version using go get github.com/foo/bar/v2 and updates their import statements to include the /v2 suffix. The build fails, claiming the package doesn't exist within the module. The developer checks the repository on GitHub and confirms the directory and files are there. They run go mod tidy repeatedly, but it fails. The rabbit hole leads them to inspect the dependency's go.mod file, where they discover the author forgot to append /v2 to the module path. Because the module path in go.mod lacks the suffix, Go's toolchain expects imports to omit it, even if the require directive uses /v2. The fix is to align the import path with the actual module path declared in the dependency's go.mod, or to vendor and replace the faulty module.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:06:54.034310+00:00— report_created — created