-
Notifications
You must be signed in to change notification settings - Fork 602
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
downloader: simplify tests #2869
downloader: simplify tests #2869
Conversation
84c3769
to
8e0179f
Compare
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, but needs to fix the YAML lint error (needs 2 spaces before comment on the same line as a value).
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
8e0179f
to
b1d0619
Compare
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, LGTM
# https://staticcheck.dev/docs/configuration/options/#checks | ||
checks: | ||
- "all" | ||
- "-SA3000" # false positive for Go 1.15+. See https://github.com/golang/go/issues/34129 |
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.
Has anybody reported this to staticcheck?
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.
Yes. It's a bug in golangci-lint and it was fixed yesterday. Will be in the next release.
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
The PR refactors tests in the
downloader
package:os.Exit
inTestMain
, as of Go 1.15, we do not need to callos.Exit(m.Run())
explicitly. See testing: TestMain should not require os.Exit golang/go#34129t.TempDir()
instead ofos.MkdirTemp
becauseTempDir
automatically removes directory.