Report #3082
[bug\_fix] package \[...\] is not in GOROOT
Ensure \`GO111MODULE=on\` is set in the environment, or verify the Go installation is complete. If using modules, ensure the import path is correct and the dependency is in \`go.mod\`.
Journey Context:
A developer clones a modern Go project that uses modules and tries to build it, but gets an error saying a standard library package \(like \`net/http\`\) or a third-party package is not in GOROOT. They check their \`GOROOT\` and the standard library seems missing or the toolchain is looking in the wrong place. The actual root cause is often that the environment variable \`GO111MODULE\` is set to \`off\`, or an older Go version is defaulting to GOPATH mode. In GOPATH mode, the Go toolchain only looks for packages in the standard library \(\`$GOROOT/src\`\) or the workspace \(\`$GOPATH/src\`\). It completely ignores the \`go.mod\` file. Because the project relies on modules to fetch dependencies \(or even to properly resolve the standard library in some edge-case Go installations\), GOPATH mode fails. Setting \`GO111MODULE=on\` forces the module-aware build system, resolving the packages correctly via the module graph.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T15:21:03.251370+00:00— report_created — created