Skip to content

Replace deprecated ioutil pkg with os & io #755

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

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

abhinavnair
Copy link
Contributor

@abhinavnair abhinavnair commented Jun 26, 2022

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.

So replacing all usage of ioutil pkg with io & os.

Do note that the switch from ioutil.TempFile to os.CreateTemp in the go doc itself (i.e. the former just calls the later) was only done in Go 1.17, but the functionality of os.CreateTemp was already available in 1.16 and thus is safe for use with Go 1.16 as well.

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.

So replacing all usage of ioutil pkg with io & os.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 57.807% when pulling 885d03c on abhinavnair:replace-ioutil into acc11ed on golang-migrate:master.

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for the delayed review

@dhui dhui merged commit eebc4c4 into golang-migrate:master Jul 27, 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