Skip to content
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

Replace deprecated ioutil #15871

Merged
merged 1 commit into from
Sep 21, 2022
Merged

Conversation

cevich
Copy link
Member

@cevich cevich commented Sep 20, 2022

Package io/ioutil was deprecated in golang 1.16, preventing podman from
building under Fedora 37. Fortunately, functionality identical
replacements are provided by the packages io and os. Replace all
usage of all io/ioutil symbols with appropriate substitutions
according to the golang docs.

Does this PR introduce a user-facing change?

Replace all use of io/ioutil (deprecated as of golang 1.16)

@cevich
Copy link
Member Author

cevich commented Sep 20, 2022

Sigh, this is incomplete. Grepping shows a total of 125 more files that need an ioutils replacement 😞

@cevich cevich marked this pull request as draft September 20, 2022 14:12
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 20, 2022
@cevich cevich changed the title Replace deprecated ioutil [WIP] [CI:BUILD] Replace deprecated ioutil Sep 20, 2022
@cevich cevich force-pushed the replace_ioutil branch 2 times, most recently from 8057a93 to fd24b25 Compare September 20, 2022 17:17
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Sep 20, 2022
@cevich cevich force-pushed the replace_ioutil branch 2 times, most recently from c261789 to c8403ac Compare September 20, 2022 17:24
@cevich
Copy link
Member Author

cevich commented Sep 20, 2022

What I did (mostly) is:

s/ioutil\.WriteFile/os.WriteFile/g
s/ioutil\.ReadFile/os.ReadFile/g
s/ioutil.TempDir/os.MkdirTemp/g
s/ioutil\.Tempfile/os.CreateTemp/g
s/ioutil\.Discard/io.Discard/g
s/ioutil\.ReadAll/io.ReadAll/g
s/"io\/ioutil"//g

Though actual replacement method varied toward the middle when I realized I had 75 more files to go 🤣

@cevich cevich force-pushed the replace_ioutil branch 3 times, most recently from d3a7b95 to ade2642 Compare September 20, 2022 18:57
@cevich cevich changed the title [WIP] [CI:BUILD] Replace deprecated ioutil Replace deprecated ioutil Sep 20, 2022
Package `io/ioutil` was deprecated in golang 1.16, preventing podman from
building under Fedora 37.  Fortunately, functionality identical
replacements are provided by the packages `io` and `os`.  Replace all
usage of all `io/ioutil` symbols with appropriate substitutions
according to the golang docs.

Signed-off-by: Chris Evich <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Sep 21, 2022

LGTM
@containers/podman-maintainers PTAL
This should not be a draft.

@cevich cevich marked this pull request as ready for review September 21, 2022 12:29
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 21, 2022
@cevich
Copy link
Member Author

cevich commented Sep 21, 2022

This should not be a draft.

I was waiting until all the tests passed.

Reviewer note: I have almost ZERO understanding of the impact any of these changes have other than passing the tests. I manually looked through all the diffs, found/fixed a few typos, but otherwise this PR is as-is, from a non-golang expert.

@rhatdan
Copy link
Member

rhatdan commented Sep 21, 2022

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@mheon
Copy link
Member

mheon commented Sep 21, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
@mheon
Copy link
Member

mheon commented Sep 21, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2022
@openshift-merge-robot openshift-merge-robot merged commit 1265548 into containers:main Sep 21, 2022
cevich added a commit to cevich/podman that referenced this pull request Sep 21, 2022
@cevich cevich deleted the replace_ioutil branch April 18, 2023 14:52
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants