a guest Oct 17th, 2019 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Generally:
  2. `protoc -flag param:param:param target-file.proto --plugin_flag=key=value,key=value:./dest/`
  4. For example:
  5. `protoc -I .:.. foo.proto --go_out=plugins=grpc,paths=source_relative:.`
  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 = "";` the `protoc-gen-go` plugin would normally create `./` but `paths=source_relative` makes it simply write `./foo.pb.go`.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand