Report #48219
[bug\_fix] package io/ioutil is not in GOROOT
Replace the deprecated standard library package with its modern equivalent. Replace \`io/ioutil\` imports with \`io\` and \`os\` functions \(\`ioutil.ReadFile\` -> \`os.ReadFile\`, \`ioutil.WriteFile\` -> \`os.WriteFile\`, \`ioutil.ReadDir\` -> \`os.ReadDir\`, \`ioutil.TempDir\` -> \`os.MkdirTemp\`, \`ioutil.TempFile\` -> \`os.CreateTemp\`\).
Journey Context:
A developer upgrades their project's Go version to 1.22 and runs \`go build\`. The build fails with 'package io/ioutil is not in GOROOT'. They are confused because \`ioutil\` has been a staple of Go for years. They check the Go release notes and discover that \`io/ioutil\` was deprecated in Go 1.16 and finally removed in later versions. The functions were moved to \`io\` and \`os\`. They do a project-wide search and replace, updating \`ioutil.ReadFile\` to \`os.ReadFile\`, \`ioutil.WriteFile\` to \`os.WriteFile\`, and so on. The build succeeds, and they commit the changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:25:02.343138+00:00— report_created — created