Skip to content
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

update protoc-gen-go and split go gRPC plugin to protoc-gen-go-grpc #325

Merged
merged 5 commits into from
Aug 29, 2022

Conversation

ido-namely
Copy link
Contributor

@ido-namely ido-namely commented Aug 24, 2022

Switch from deprecated protoc-gen-go, which included the gRPC plugin, to the new version - https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go.

This means we need to separately install and invoke the grpc plugin - protoc-gen-go-grpc
See more info here - golang/protobuf#1070 (comment)

  • In addition, the new grpc plugin introduces a new behavior for future compatibility of generated gRPC servers, which is a breaking change, thus this behavior is disabled by default and can be enabled by invoking the arg - --go-grpc-require-unimplemented-servers

Please note that this still introduces somewhat of a breaking change, since the plugin now generates its code in a separate file (see examples used in the test file of this PR).

This version is currently available in docker image namely/protoc-all:1.47_3-rc.1

Credits: inspired by @caseybarker PR - #290

echo " --go-package-map Map proto imports to go import paths"
echo " --go-plugin-micro Replaces the Go gRPC plugin with go-micro"
echo " --go-proto-validator Generate Go proto validations - see https://github.com/mwitkow/go-proto-validators"
echo " --go-grpc-require-unimplemented-servers Generate Go gRPC service with unimplemented server for future compatability- https://github.com/grpc/grpc-go/tree/master/cmd/protoc-gen-go-grpc#future-proofing-services"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual addition, the rest are just tabs

@ido-namely ido-namely marked this pull request as ready for review August 24, 2022 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants