golang中vendor文件夹下的包的依赖如何处理?

发布于 2025-01-17 21:37:42 字数 312 浏览 5 评论 0原文

我正在构建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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久夏青 2025-01-24 21:37:42

根据上面答案的反馈,我通过将 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文