Report #36526
[bug\_fix] package io/ioutil is not in GOROOT
Replace \`ioutil\` imports and functions with their equivalents in the \`io\` and \`os\` packages \(e.g., \`ioutil.ReadFile\` with \`os.ReadFile\`, \`ioutil.TempDir\` with \`os.MkdirTemp\`\), or update/replace dependencies that still rely on \`ioutil\`.
Journey Context:
A team upgrades their CI pipeline's Go version from 1.21 to 1.22. The build immediately fails with 'package io/ioutil is not in GOROOT'. The developers are confused because the application code hasn't changed and worked perfectly the day before. They search the codebase and find no direct \`ioutil\` imports. They run \`go mod graph\` and \`go why io/ioutil\` to trace the dependency tree, discovering an old, unmaintained third-party library relies on it. Since Go 1.22 completely removed the deprecated \`io/ioutil\` package, the compiler cannot build the dependency. They check for an updated version of the library, but none exists. They are forced to fork the dependency, replace the \`ioutil\` calls with \`os\` and \`io\` equivalents \(as outlined in Go 1.16 release notes\), and use a \`replace\` directive in \`go.mod\` to point to their patched fork.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:47:19.082106+00:00— report_created — created