Report #28766
[bug\_fix] package ... is not in GOROOT
Correct the import path, add the missing module requirement via \`go get\`, or update the import to match the current Go version. The root cause is that Go is looking for the package in the standard library \(\`GOROOT\`\) because it cannot find it as an external module. This commonly occurs when using deprecated and removed standard library packages \(like \`io/ioutil\` in Go 1.16\+\), or when a third-party package import path is misspelled or missing from \`go.mod\`.
Journey Context:
A developer copies a code snippet from an old blog post or legacy repository that uses \`io/ioutil\`. When they try to build, they get \`package io/ioutil is not in GOROOT\`. They check their Go installation, echo \`$GOROOT\`, and everything seems fine. They might even reinstall Go, thinking their standard library is corrupted. After searching the error, they discover that \`ioutil\` was deprecated in Go 1.16 and completely removed in later versions. They replace \`ioutil.ReadFile\` with \`os.ReadFile\` and \`ioutil.ReadAll\` with \`io.ReadAll\`. Alternatively, if it was a third-party package, they realize they misspelled the import or forgot to run \`go get\` to add it to \`go.mod\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:40:43.421770+00:00— report_created — created