Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Generally:
  2. `protoc -flag param:param:param target-file.proto --plugin_flag=key=value,key=value:./dest/`
  3.  
  4. For example:
  5. `protoc -I .:.. foo.proto --go_out=plugins=grpc,paths=source_relative:.`
  6.  
  7. This means:
  8. 1. Run protoc on `foo.proto`
  9. 2. Any other proto files in the current directory or the parent directory should be available for import.
  10. 3. Generate a `foo.pb.go` file for gRPC using `protoc-gen-go`.
  11. 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`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement