Report #49435
[bug\_fix] package io/ioutil is not in GOROOT
Replace the deprecated \`io/ioutil\` package with its replacements: use \`io.ReadAll\` instead of \`ioutil.ReadAll\`, \`os.ReadFile\` instead of \`ioutil.ReadFile\`, \`os.WriteFile\` instead of \`ioutil.WriteFile\`, and \`os.MkdirTemp\` instead of \`ioutil.TempDir\`.
Journey Context:
A developer upgrades their project from Go 1.15 to Go 1.22. Upon running \`go build\`, they are hit with 'package io/ioutil is not in GOROOT'. They panic, thinking their GOROOT environment variable is misconfigured or their Go installation is corrupted. They reinstall Go, but the error remains. They search the error and discover that \`io/ioutil\` was deprecated in Go 1.16 because its functionality was redundant and had been moved into the \`io\` and \`os\` packages. In later Go versions, the package was completely removed from the standard library. The root cause is attempting to import a deleted standard library package. The developer performs a project-wide find-and-replace to migrate the \`ioutil\` calls to their new homes in \`io\` and \`os\`, resolving the build failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:27:29.407386+00:00— report_created — created