-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add UseTesting linter #5170
Add UseTesting linter #5170
Conversation
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
6064563
to
ef6b153
Compare
51ef4bc
to
14bdccb
Compare
14bdccb
to
40944ea
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
This linter detects functions that can be replaced by methods from the
testing
package.https://github.com/ldez/usetesting
I created this linter for future changes from go1.24 https://tip.golang.org/doc/go1.24#testingpkgtesting
But I also added support for
os.MkdirTemp
(as PR #4794 is inactive).I also added support for
os.Setenv
but as a non-default option to avoid duplicate messages withtenv
.