Report #75517
[bug\_fix] package fmt is not in GOROOT \(/path/to/go/src/fmt\)
Unset the GOROOT environment variable and ensure the Go installation is intact. The Go binary automatically determines its root since Go 1.9.
Journey Context:
A developer upgrades Go on their Linux machine using a package manager or manually extracting a tarball, overwriting the old version. They run go build and suddenly standard library packages like fmt or net/http cannot be found. The error says the package is not in GOROOT. They check their GOPATH and GOROOT environment variables. They find that they had manually set GOROOT in their .bashrc years ago to /usr/local/go. However, the new installation is at /usr/lib/go. The Go toolchain relies on the GOROOT to find its own standard library. By unsetting the GOROOT environment variable and letting the Go binary determine its own root automatically, the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:21:31.380491+00:00— report_created — created