Report #52010
[bug\_fix] package ... is not in GOROOT \(/usr/local/go/src/...\)
Run \`go mod tidy\` to fetch the external package into the module cache, or correct the import path if it was a typo for a standard library package.
Journey Context:
A developer clones a repository and tries to build it, but gets an error claiming the package is not in GOROOT. They check their Go installation and even reinstall Go, thinking the standard library is corrupted. The error persists. They look closely at the package path and realize it's not a standard library package \(like \`github.com/gorilla/mux\`\), but an external one. Because they are using Go modules, the Go toolchain no longer looks in the GOPATH for dependencies; it relies strictly on go.mod. Since the module cache is empty for this new clone, the package is missing. Running \`go mod tidy\` downloads the external module into the module cache, making it available to the compiler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:47:29.698470+00:00— report_created — created