duanliao5995 2019-07-27 00:18
浏览 540

编译protobuf并尝试在其他软件包中使用时,未定义结构的MarshalToSizedBuffer

I'm using gogo/protobuf to generate protobufs for gRPC calls but recently they started failing due a marshalling method not being correctly generated. The error looks like this:

service/v1/service.pb.go:1347:27: m.ListMeta.MarshalToSizedBuffer undefined (type *"k8s.io/apimachinery/pkg/apis/meta/v1".ListMeta has no field or method MarshalToSizedBuffer)

I've tried reinstalling go and goenv, using a different gvm, and reverting changes to the proto files. The issue seems to resolve on our last stable branch of our proto files but if I make any changes the issue recurs. This is across two repos, one (proto files repo) using golang 1.11.1 and the other using golang 1.12.5.

I expected all methods that the protobufs needed to be generated in using the package.

  • 写回答

1条回答 默认 最新

  • douzhanlie9209 2019-08-02 16:47
    关注

    We resolved this issue by fixing the dependencies to a prior working version and upping our different golang repo's to be in the same major version.

    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法