a guest Oct 17th, 2019 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- `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:
- 1. Run protoc on `foo.proto`
- 2. Any other proto files in the current directory or the parent directory should be available for import.
- 3. Generate a `foo.pb.go` file for gRPC using `protoc-gen-go`.
- 4. If `foo.proto` were to have a declaration of `option go_package = "github.com/bar/baz";` the `protoc-gen-go` plugin would normally create `./github.com/bar/baz/foo.pb.go` but `paths=source_relative` makes it simply write `./foo.pb.go`.
RAW Paste Data