GrantZheng / kit

GoKit CLI
MIT License
268 stars 54 forks source link

choose a protoc-gen-go version #22

Closed bootun closed 2 years ago

bootun commented 2 years ago

this project uses golang/protobuf to generate code(this repository are deprecated), the gRPC code generator is built-in in, so it supports the expression protoc --go_out=plugins=grpc:., but when we want to use the new version of protoc-gen-go, they are two separate files and not support plugin=xxx mechanism. if we want to generate code, we need to use some separate flags like this:

protoc --go_out=. --go_opt=paths=source_relative  --go-grpc_out=. --go-grpc_opt=paths=source_relative xxx.proto

but golang/protobuf is not supporting this expression, as far as I know, many people still use golang/protobuf as their code generator, so which version should be chosen for this project?

resource

bootun commented 2 years ago

both version of protoc support protc --go_out=xxx --go-grpc_out=xxx, but if we uses golang/protobuf, we need install protoc-gen-go-grpc to supports the separate flag expression.

which grammar should we adapt to?