dtdvbf37193 2015-11-26 03:19
浏览 721

使用protoc-gen-go创建一个.pb.go,该文件会导入google / golang但找不到包

I'm using protoc-gen-go to compile C Protocol Buffers into Golang which works great and I can almost go install the package but I get this error:

cannot find package "google/protobuf"

but I cannot find this package anywhere to download, can anybody tell me what I should do with this? Thanks.

I'm following all steps to doing it from here

then I run protoc --go_out=. *.proto and I get all my files, but the wrong proto import

  • 写回答

1条回答 默认 最新

  • dozan0001 2015-11-26 07:49
    关注

    as @poopoothegoriall said, please use the protobuf from github, other than code-google. the generated .pb.go file will import "github.com/golang/protobuf/proto"

    UPDATE this is my steps:

    1. make install project https://github.com/google/protobuf.git
    2. go get https://github.com/golang/protobuf
    3. generate the go source by protoc --go_out=. xxx.proto
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大