Report #45010
[bug\_fix] no required module provides package github.com/user/repo/pkg
Run \`go mod tidy\` to add missing dependencies, or ensure \`GO111MODULE\` is not set to \`off\`. If migrating from GOPATH, run \`go mod init\` and \`go mod tidy\`.
Journey Context:
A developer clones an older repository that was built using GOPATH. They run \`go build\` on Go 1.18\+ and get 'no required module provides package'. They check their GOPATH and the packages are missing. They try setting \`GO111MODULE=auto\` but it fails. The root cause is that starting with Go 1.16, module mode is enabled by default \(\`GO111MODULE=on\`\), and the toolchain ignores GOPATH \`src\` directories entirely. Without a \`go.mod\` file, the toolchain doesn't know where to find dependencies. The fix is to initialize modules in the project by running \`go mod init \` followed by \`go mod tidy\`, which analyzes imports, fetches dependencies from the network, and generates the required \`go.mod\` and \`go.sum\` files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:01:06.341848+00:00— report_created — created