doudichu1358 2018-02-21 19:31
浏览 211

生成Golang grpc +自定义原型对象

I am trying to generate a gRPC client that returns a self defined proto object. This is my current proto command

protoc -I.:../ --go_out=plugins=grpc:Muser/messages.proto=github.com/.../.../user:. messages.proto

and this is the error Muser/messages.proto=github.com/.../.../user:./: No such file or directory

However this command:

protoc -I.:../ --go_out=Muser/messages.proto=github.com/.../.../user:. messages.proto

and this one:

protoc -I.:../ --go_out=plugins=grpc:. messages.proto

work perfectly. The problem is when I try to use the plugins:grpc part in conjunction to the path of the user/messages.proto file.

Any clue what the problem might be?

  • 写回答

1条回答 默认 最新

  • douzuo0002 2018-02-28 19:40
    关注

    Per the protoc documentation here: https://github.com/golang/protobuf#parameters

    To pass extra parameters to the plugin, use a comma-separated parameter list separated from the output directory by a colon:

    So I believe the right command would be: protoc -I.:../ --go_out=plugins=grpc,Muser/messages.proto=github.com/.../.../user:. messages.proto

    评论

报告相同问题?

悬赏问题

  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题