Report #63035
[bug\_fix] package io/fs is not in GOROOT
Upgrade the Go toolchain used for building to the version specified in the go.mod file's go directive \(e.g., Go 1.16\+ for io/fs\).
Journey Context:
A developer clones a repository and runs go build, which fails with 'package io/fs is not in GOROOT'. They check the go.mod file and see go 1.21. They look at the source code and confirm io/fs is a standard library package. They run go version and realize their local Go installation is 1.19. They update their local Go, and the build succeeds locally. However, the CI pipeline still fails with the same error. The rabbit hole involves trying to go get the standard library \(which fails\), checking if the package was accidentally deleted, and verifying GOROOT environment variables. The root cause is that the go directive in go.mod specifies the minimum required Go version, but the active toolchain executing the build is older and doesn't contain the requested standard library package \(which was introduced in a newer release\). Upgrading the toolchain in the CI environment or using Go's automatic toolchain management resolves the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:17:13.577081+00:00— report_created — created