run:
protoc protoc/route_guide.proto --go_out=plugins=grpc:.
output:
--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC
The google.golang.org/protobuf/cmd/protoc-gen-go program doesn't include gRPC support. Instead, that support will soon be provided by a google.golang.org/grpc/cmd/protoc-gen-go-grpc program. That program is In code review now, but not quite yet available.
The github.com/golang/protobuf/protoc-gen-go program supports gRPC as always, and will continue to do so. Versions v1.4 and newer of that program support the new protobuf reflection features. (Right now, the newest release is v1.4.0-rc.4.)
@neild, thanks for update. Could you provide very approximate date for gRPC support in google.golang.org/protobuf/cmd/protoc-gen-go?
google.golang.org/protobuf/cmd/protoc-gen-go will never have explicit gRPC support. We've split it out into a separate program (protoc-gen-go-grpc), so the gRPC code generator can live in the gRPC repository and follow that repo's release cycle.
The practical effect is that when using this generator you will need to specify two flags on the protoc command line (or run protoc twice):
protoc --go_out=. --go-grpc_out=. foo.proto
The original github.com/golang/protobuf/protoc-gen-go will continue to directly support gRPC generation indefinitely, to avoid breaking existing users.
Ok, this is better approach, I agree. I will rephrase my question though: could you provide very approximate date when google.golang.org/protobuf/cmd/protoc-gen-go-grpc is available?
Whenever https://github.com/grpc/grpc-go/pull/3453 is approved and merged; unfortunately, the timing of that isn't under my control, so I can't give even an approximate date. It's in the gRPC folks' hands right now, but current events have everyone working at reduced capacity and I don't know where this is on their priority list.
Thanks @neild. I am super excited about V2. Great job!
I'm going to close this issue, since it seems to be a duplicate of #903
This doc needs to be updated.
I recommend filing an issue on https://github.com/grpc/grpc-go/issues
It seems strange to give a warning and recommend using a plugin that does not yet exist.
How to use original github.com/golang/protobuf/protoc-gen-go? The new way just broke all my codebase...
Most helpful comment
It seems strange to give a warning and recommend using a plugin that does not yet exist.