8000 refactor: replace deprecated `ioutil` with `io`/`os` equivalents by honeynil · Pull Request #427 · google/wire · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: replace deprecated ioutil with io/os equivalents #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

honeynil
Copy link

Changes

  • Replaced all deprecated ioutil functions with their io or os equivalents (supported since Go 1.16+).
  • Removed unused io/ioutil imports.
  • Verified that tests pass (go test ./...).

Motivation

The ioutil package is deprecated as of Go 1.16 (see Go 1.16 release notes).
This change follows the official migration guidance to modernize the codebase.

Testing

  • All existing tests pass.
  • Manually verified the changes in a sample project.

Notes

This is a backward-compatible change since io/os equivalents exist in all supported Go versions.

Copy link
google-cla bot commented Jun 19, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

)

func main() {
r := injectedReader()
buf, _ := ioutil.ReadAll(r)
buf, _ := io.ReadAll(r) // ioutil.ReadAll --> io.ReadAll

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this comment for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion! I deleted my previous comment as it was irrelevant to the PR.
The changes are ready for your review. Thanks!

@honeynil honeynil requested a review from burik666 June 19, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0