When creating an API with protobuf, the protoc compiler will also generate server and client stubs to help create your application. To create stubs in Go, I would normally use protoc --go_out=./ api.proto. If the stubs stop being generated in the .pb.go file, you may need to force protoc to use the compiler for your specific language and protocol, such as protoc --go_out=plugins=grpc:. api.proto. Check the GitHub page for your desired compiler for details.

Previous Post Next Post