-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove uses of deprecated io/ioutil, and use new t.TempDir() and t.Cleanup() in tests #3443
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
Conversation
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
The package has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil Signed-off-by: Sebastiaan van Stijn <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #3443 +/- ##
=======================================
Coverage 58.24% 58.24%
=======================================
Files 287 287
Lines 24155 24155
=======================================
Hits 14070 14070
Misses 9225 9225
Partials 860 860 |
|
When reviewing, I recommend doing so per commit (as github doesn't like showing the whole diff 😅) most of them should be easy to review, but perhaps some may need closer looking (where I refactored or removed some test-utils for |
|
@silvin-lubecki @ndeloof @crazy-max ptal 🤗 |
| depguard: | ||
| list-type: blacklist | ||
| include-go-root: true | ||
| packages: | ||
| # The io/ioutil package has been deprecated. | ||
| # https://go.dev/doc/go1.16#ioutil | ||
| - io/ioutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have that in buildkit too (cc @tonistiigi)
crazy-max
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ndeloof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I like use of t.TempDir() that don't force us to manage a cleanup function 👍
|
Yes! I also want to have a look at uses of |
|
ok, let me get this one in; thanks for reviewing! |
I had a "WIP" branch for this locally, and decided to finish the work; there's quite some uses of this package, so I split this up into commits per-package for easier reviewing.
Current versions of Go also added
t.TempDIr()andt.Cleanup()for tests, so while at it, I updated tests to use those (which simplified the tests).Finally, I updated the
golangci-lintconfiguration to prevent the package from accidentally being added again.