Report #50565
[bug\_fix] package io/fs is not in GOROOT
Update the \`go\` directive in \`go.mod\` to the Go version that introduced the package \(e.g., \`go 1.16\`\), and ensure the local Go toolchain matches or exceeds this version.
Journey Context:
A developer clones a project that uses \`io/fs\` or \`embed\`. They run \`go build\` and get 'not in GOROOT'. They check their Go version \(\`go version\`\) and see they are running Go 1.15. They update to Go 1.22, but it still fails. They look at \`go.mod\` and see \`go 1.15\`. The Go toolchain uses the \`go\` directive in \`go.mod\` to determine language and standard library availability. Even with a modern Go binary installed, if \`go.mod\` says \`go 1.15\`, the toolchain restricts the available standard library to the 1.15 subset, which doesn't include \`io/fs\`. Updating the \`go\` directive tells the toolchain to enable the newer standard library packages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:21:35.359968+00:00— report_created — created