chore: Enable protogetter linter and run fixes#2638
Open
tstirrat15 wants to merge 1 commit intomainfrom
Open
Conversation
30f414d to
c149d58
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2638 +/- ##
==========================================
- Coverage 76.99% 76.96% -0.03%
==========================================
Files 462 462
Lines 49121 49124 +3
==========================================
- Hits 37815 37801 -14
- Misses 8519 8526 +7
- Partials 2787 2797 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c149d58 to
e825f57
Compare
3008292 to
45d4100
Compare
tstirrat15
commented
Oct 23, 2025
Contributor
Author
tstirrat15
left a comment
There was a problem hiding this comment.
These are the only two files that I touched manually
Comment on lines
-27
to
+31
| return *written.Counter.Value | ||
| counter := written.GetCounter() | ||
| if counter == nil { | ||
| panic("counter was nil") | ||
| } | ||
| return counter.GetValue() |
Contributor
Author
There was a problem hiding this comment.
This is a meaningful change - we were actually depending on this to panic if Counter was nil, so the nil-safety fix kinda broke the functionality.
Comment on lines
-16
to
+17
| if result != 0.0 { | ||
| t.Errorf("Initial counter value should be 0.0, got %v", result) | ||
| } | ||
| require.Equal(t, 0.0, result, "Initial counter value should be 0.0") |
Contributor
Author
There was a problem hiding this comment.
Refactoring these tests to use require to bring them in line with the rest of the codebase.
45d4100 to
767f8fa
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2633
Part of #2579
Description
If you have a deeply nested proto object, calling
a.GetSet().GetOf().GetGetters()is safer than referencingsome.Chain.Of.Properties, because the first will returnnilif there's a nil in the chain, where the second will panic.protogetterlints for this and should help address #2579.Changes
Testing
Review. See that tests pass.