-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 package #9811
Conversation
@Juneezee Thanks for this! It does look like there were some failed lint issues:
Would you mind getting the tests green and I can go through and verify the correct updates were made in a review? Thanks again! |
internal/process/process.go
Outdated
io.Copy(ioutil.Discard, r) | ||
io.Copy(io.Discard, r) |
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.
@powersj Hi, thanks for taking the time to review this PR. I believe these lint errors have existed before this PR, and they are reported because lines like these have been modified in this PR.
To make the lint passes, the easiest way is to ignore the error. I'll force push a new commit now.
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.
io.Copy(ioutil.Discard, r) | ||
_, _ = io.Copy(io.Discard, r) |
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.
Fix for lint error 1
io.Copy(ioutil.Discard, resp.Body) | ||
_, _ = io.Copy(io.Discard, resp.Body) |
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.
Fix for lint error 2
go ioutil.ReadAll(r) | ||
go func() { | ||
_, _ = io.ReadAll(r) | ||
}() |
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.
Fix for lint error 3
go ioutil.ReadAll(r) | ||
go func() { | ||
_, _ = io.ReadAll(r) | ||
}() |
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.
Fix for lint error 4
@powersj Please take a look again. Many thanks 😄 |
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.
+1 on the changes. Verified the branch no longer has any references to ioutil
, ensured that the changes were made according to the deprecation notice, and that the binary built and a basic config ran.
Marking ready for final review.
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <[email protected]>
Looks like new artifacts were built from this PR. Get them here!Artifact URLs |
(cherry picked from commit 6a3b271)
Required for all PRs:
Partly related to #9642
Hi! The
io/ioutil
package has been deprecated in Go 1.16 (See https://golang.org/doc/go1.16#ioutil). This PR replaces the existingio/ioutil
functions with their new definitions inio
andos
packages.Special notes for reviewers
No breaking changes.