golang中vendor文件夹下的包的依赖如何处理?
我正在构建GO二进制文件,它正在使用供应商使用GO模块来管理依赖关系。但是,每次我构建二进制文件时,都会出现诸如“ proto.isversion3”之类的错误。
现在,我认为这可能是因为供应商领导下的依赖性不再有自己的供应商,也就是说,子包装。但是我该如何克服这个问题?
整个过程就像“ go mod Init& amp;” Go Mod Tidy&& Go Mod Mod供应商&& CGO_ENABLED = 0 Goos = Linux GOARCH = AMD64 GO111MODULE = OFF GO(1.12)构建....'
I am building a go binary and it is using go module through vendor to manage the dependencies. But each time I am building the binary an error like "proto.IsVersion3" is presented.
Now I think this may be because the dependency under vendor doesn't have its own vendor again, that is to say, sub-package. But how can I overcome this issue?
The whole process is like `go mod init && go mod tidy && go mod vendor && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=off go (1.12) build ....'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据上面答案的反馈,我通过将 protobuf 版本替换为较新的版本解决了这个问题,看来 protobuf v1.1.0 没有实现 ProtoPackageIsVersion3
With feedback from above answers, I solved this problem by just replacing the protobuf version to a newer one, it seems the protobuf v1.1.0 isn't implemented ProtoPackageIsVersion3