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

Migrate use of ioutil.ReadFile (deprecated) to os.ReadFile #5897

Closed
buzzsurfr opened this issue Dec 27, 2022 · 2 comments · Fixed by #5906
Closed

Migrate use of ioutil.ReadFile (deprecated) to os.ReadFile #5897

buzzsurfr opened this issue Dec 27, 2022 · 2 comments · Fixed by #5906
Assignees
Labels

Comments

@buzzsurfr
Copy link
Contributor

go's parser gives a warning about 42 references to ioutil.ReadFile in the repo, stating:

"io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)

An example offending line is interop/client/client.go#L156

b, err := ioutil.ReadFile(*caFile)

According to the message, this should be replaced with os.ReadFile.

What version of gRPC are you using?

1.51

What version of Go are you using (go version)?

go1.19.4 darwin/arm64

What operating system (Linux, Windows, …) and version?

MacOS, but applies to all


Created via thread in #5882 (comment)

/assign @buzzsurfr

@easwars
Copy link
Contributor

easwars commented Dec 29, 2022

Thanks for filing this issue. And thanks for volunteering to work on this.

@buzzsurfr
Copy link
Contributor Author

After further review, the entire package io/ioutil has been deprecated. I submitted a commit on the PR for just ReadFile but will submit another commit for the rest of the package use.

easwars pushed a commit that referenced this issue Jan 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants