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 #566

Merged
merged 1 commit into from
Oct 17, 2022
Merged

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

merged 1 commit into from
Oct 17, 2022

Conversation

Juneezee
Copy link
Contributor

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

  • 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, this may improve performance in some cases as os.ReadDir is more efficient [1])
  • ioutil.ReadFile => os.ReadFile
  • ioutil.TempDir => os.MkdirTemp
  • ioutil.TempFile => os.CreateTemp
  • ioutil.WriteFile => os.WriteFile

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>
@6za
Copy link
Contributor

6za commented Oct 17, 2022

Thanks so much for your contribution.

Copy link
Contributor

@6za 6za left a comment

Choose a reason for hiding this comment

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

Great Work! Thanks for the contribution!

@converge converge self-requested a review October 17, 2022 16:38
@6za 6za merged commit ddc4de8 into konstructio:main Oct 17, 2022
@converge
Copy link
Contributor

tested with task unit-test

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.

4 participants