-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
add protogetter linter #4069
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 protogetter linter #4069
Conversation
Hey, thank you for opening your first Pull Request ! |
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
|
FYI 0.0.x are not semver complaint because a bug fix cannot happen before a minor release or an impossible initial version v0.0.0.
https://semver.org/#how-should-i-deal-with-revisions-in-the-0yz-initial-development-phase |
@ldez I fixed the version |
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.
some elements don't fit our checklist (see my previous message)
Because my linter tests require a dependency on
I'm importing
T=protogolint make test_linters
|
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
ProtoGetter analyzes code and helps detect direct
protobuf
field accesses that could give rise to panic.The linter suggests using getters:
instead of direct field access:
A little more information: golang/protobuf#54 (comment)
Examples:
With getters:
With fileds: