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

refactor: move from io/ioutil to io and os packages #858

Merged
merged 2 commits into from
Nov 16, 2022
Merged

refactor: move from io/ioutil to io and os packages #858

merged 2 commits into from
Nov 16, 2022

Conversation

Juneezee
Copy link
Contributor

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

The io/ioutil package has been deprecated in Go 1.16 (See https://pkg.go.dev/io/ioutil). We can replace the existing io/ioutil functions with their new definitions in io and os packages.

What changes did you make?

  • ioutil.Discard => io.Discard
  • ioutil.NopCloser => io.NopCloser
  • ioutil.ReadAll => io.ReadAll
  • ioutil.ReadDir => os.ReadDir (returns a slice of os.DirEntry rather than a slice of fs.FileInfo)
  • ioutil.ReadFile => os.ReadFile
  • ioutil.TempDir => os.MkdirTemp
  • ioutil.TempFile => os.CreateTemp
  • ioutil.WriteFile => os.WriteFile

What alternative solution should we consider, if any?

Juneezee and others added 2 commits October 4, 2022 09:25
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@mggude
Copy link
Contributor

mggude commented Nov 15, 2022

Welcome and thanks for the contribution, we will try to get this reviewed and merged very soon. Thanks again!

@rbren rbren merged commit 8bc1a4b into FairwindsOps:master Nov 16, 2022
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.

3 participants