cmd/protoc-gen-go-grpc: test the embedded struct at registration time for proper usage#7438
Merged
dfawley merged 5 commits intogrpc:masterfrom Jul 24, 2024
Merged
cmd/protoc-gen-go-grpc: test the embedded struct at registration time for proper usage#7438dfawley merged 5 commits intogrpc:masterfrom
dfawley merged 5 commits intogrpc:masterfrom
Conversation
easwars
approved these changes
Jul 24, 2024
cmd/protoc-gen-go-grpc/grpc.go
Outdated
Comment on lines
+313
to
+315
| g.P("// If the following call pancis, it indicates Unimplemented", serverType, " was embedded by pointer") | ||
| g.P("// and is nil. This will cause panics if an unimplemented method is ever invoked, so we test this") | ||
| g.P("// at initialization time to prevent it from happening at runtime later due to I/O.") |
Contributor
There was a problem hiding this comment.
Nit: Could these comments also be wrapped at 80-cols. Thanks.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7438 +/- ##
==========================================
- Coverage 81.44% 81.33% -0.11%
==========================================
Files 352 352
Lines 26919 26919
==========================================
- Hits 21924 21895 -29
- Misses 3804 3822 +18
- Partials 1191 1202 +11 |
printchard
pushed a commit
to printchard/grpc-go
that referenced
this pull request
Jul 30, 2024
… for proper usage (grpc#7438)
printchard
pushed a commit
to printchard/grpc-go
that referenced
this pull request
Jul 30, 2024
… for proper usage (grpc#7438)
16 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
relnotes for cmd/protoc-gen-go-grpc:
Register<Service>Servernow panics if theUnimplemented<Service>Serverstruct is embedded in a way that would lead to runtime panics if an unimplemented method was called. Users are advised to ensure they are properly embedding theUnimplementedstruct for their service, and to regenerate their proto files to confirm.RELEASE NOTES: none