-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 #3294
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3294 +/- ##
==========================================
+ Coverage 95.86% 95.98% +0.11%
==========================================
Files 259 259
Lines 15413 15413
==========================================
+ Hits 14776 14794 +18
+ Misses 548 525 -23
- Partials 89 94 +5
Continue to review full report at Codecov.
|
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
@albertteoh can you check why code cov is down? I'd expect refactoring not to do that. |
It's because, unfortunately, those lines (cmd/anonymizer/app/anonymizer/anonymizer.go lines 83 & 110) were not covered in the first place (the red gutters indicate no coverage): Code cov's coverage metric is computed off the diff, which means the refactorings touching these few lines uncovered can cause a PR to not pass the 95% diff coverage threshold. We'd need to add some basic tests for these lines. @Juneezee, would you mind adding some tests to anonymizer's |
@albertteoh No problem. I will work on it. |
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 <engzerjun@gmail.com>
Thanks @Juneezee, please rebase as well. |
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.
} | ||
|
||
for _, tt := range tests { | ||
tt := tt |
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.
nit: this will work but I don't think it's necessary; it's really only useful when referring to its pointer reference or if being used concurrently.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
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.
Thanks!
Which problem is this PR solving?
Remove all usage of
io/ioutil
functionsShort description of the changes
The
io/ioutil
package has been deprecated in Go 1.16 (See https://golang.org/doc/go1.16#ioutil). Since Jaeger has upgraded to Go 1.17 (#3220), this PR replaces the existingio/ioutil
functions with their new definitions inio
andos
packages.