-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
add linter: nilnesserr #5240
base: master
Are you sure you want to change the base?
add linter: nilnesserr #5240
Conversation
Signed-off-by: alingse <[email protected]>
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
|
Signed-off-by: alingse <[email protected]>
Signed-off-by: alingse <[email protected]>
@ldez I have append new commit to fix the unchecked box. |
Co-authored-by: Oleksandr Redko <[email protected]>
Signed-off-by: alingse <[email protected]>
Linter
url https://github.com/alingse/nilnesserr
nilnesserr
report that return a nil value error after check some err not nilDetail
The difference between
nilness
andnilerr
is thatnilnesserr
can analyze whether an err is nil in some complex positions through SSA (using code fromnilness
and has been modified), which can help avoid some unrelated error returns. the nilerr only checked the latestif
block and the const nilI also used https://github.com/alingse/go-linter-runner to analyze some public go repos and fixed some false-positive bug. the result can be seen at alingse/sundrylint#4 and alingse/nilnesserr#2 (the comment with 🚀)