Report #2243
[bug\_fix] package ... is not in GOROOT \(/usr/local/go/src/...\)
Ensure GO111MODULE is not set to off, and run go mod init or go mod tidy to create or update the go.mod file.
Journey Context:
A developer clones a repository and attempts to build it, but gets an error saying a third-party package is not in GOROOT. They are confused because it's a standard external dependency, not part of the standard library. They check their environment and realize their shell has GO111MODULE=off set from an old workflow, or the project lacks a go.mod file. Because Go is operating in GOPATH mode, it looks for dependencies in the local GOPATH/src or GOROOT/src directories instead of fetching them from the internet. The developer unsets GO111MODULE \(defaulting to on in Go 1.16\+\) and runs go mod init, allowing Go to fetch the dependency properly as a module.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T10:20:36.955753+00:00— report_created — created