How to create a protobuf go plugin plugin

https://github.com/golang/protobuf

protoc-gen-go is a protoc plugin that generates go bindings to define an input proto.

protoc-gen-go also has a plugin structure for which grpc is a plugin plugin https://github.com/golang/protobuf/tree/master/protoc-gen-go/grpc

$ protoc ./helloworld.proto --go_out=plugins=grpc:.

Is it possible that I will write my own plugin and call it together with the grpc plugin?

$ protoc ./helloworld.proto --go_out=plugins=grpc+myplugin:.

Do I need to create my plugin in protoc-gen-go? if not, then how does the duct-go-gene find myplugin?

+6
source share

Source: https://habr.com/ru/post/1015113/


All Articles