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

fix: use ioutil for Go 1.15 and lower #492

Merged
merged 1 commit into from Jan 17, 2022
Merged

fix: use ioutil for Go 1.15 and lower #492

merged 1 commit into from Jan 17, 2022

Conversation

blgm
Copy link
Collaborator

@blgm blgm commented Jan 17, 2022

Since Go 1.16 it has been recommended to no longer use ioutil in new
code. We want Gomega to look modern so we removed references to ioutil,
which also removes the chance of outdated code being copied. However we
got feedback that some users were stuck on Go 1.15 and lower and were
broken by this change. We have therefore introduces a "gutil" package
that implements similar functions to ioutil and redirect to the right
functions appropriate to the version of Go. This will hopefully:

  • make it look intentional that ioutil is still used (rather than
    looking like an omission)
  • reduce the chance of ioutil usage being propagated by copying
  • limit the possibility of deprecation warnings

Since Go 1.16 it has been recommended to no longer use ioutil in new
code. We want Gomega to look modern so we removed references to ioutil,
which also removes the chance of outdated code being copied. However we
got feedback that some users were stuck on Go 1.15 and lower and were
broken by this change. We have therefore introduces a "gutil" package
that implements similar functions to ioutil and redirect to the right
functions appropriate to the version of Go. This will hopefully:
- make it look intentional that ioutil is still used (rather than
looking like an omission)
- reduce the chance of ioutil usage being propagated by copying
- limit the possibility of deprecation warnings
@onsi
Copy link
Owner

onsi commented Jan 17, 2022

hey @blgm this looks good to me! It's a fair compromise and I'm happy to pull it in.

@onsi onsi merged commit c29c1c0 into master Jan 17, 2022
@onsi onsi mentioned this pull request Jan 17, 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.

None yet

2 participants