Generally:
protoc -flag param:param:param target-file.proto --plugin_flag=key=value,key=value:./dest/
For example:
protoc -I .:.. foo.proto --go_out=plugins=grpc,paths=source_relative:.
This means:
- Run protoc on
foo.proto - Any other proto files in the current directory or the parent directory should be available for import.
- Generate a
foo.pb.gofile for gRPC usingprotoc-gen-go. - If
foo.protowere to have a declaration ofoption go_package = "github.com/bar/baz";theprotoc-gen-goplugin would normally create./github.com/bar/baz/foo.pb.gobutpaths=source_relativemakes it simply write./foo.pb.go.