gpt4 book ai didi

go - 无法使用 godeps 更新依赖包

转载 作者:数据小太阳 更新时间:2023-10-29 03:09:25 25 4
gpt4 key购买 nike

我需要更新 stripe-go 库版本。项目有 19.**新版本 52.**有一个godeps依赖管理器

当我尝试运行时

godep save github.com/stripe/stripe-go

我明白了

godep: cannot save github.com/stripe/stripe-go/form at revision f8b095462d541c43d981d28de52b7464b25f3ee1: already have github.com/stripe/stripe-go at revision 87c04229ff0262e4e7dfc8af7dc97a471e955ba2.

Run `godep update github.com/stripe/stripe-go' first.

当我运行的时候

godep update github.com/stripe/stripe-go

我明白了

godep: no packages can be updated

我做错了什么?

最佳答案

我记得这个问题,引用自https://github.com/tools/godep/issues/164#issuecomment-101345584

This seems to be caused by this line here: https://github.com/tools/godep/blob/master/update.go#L205

If packages A and B are under the same root, and I try to only update B, the root will be marked for skipping update because A isn't being updated. I'm not sure what the motivation for this feature is, it seems that developers should be able to selectively update sub packages as they desire.

For what it's worth, I fixed my problem by globbing from the root in my godep update command (e.g. godep update github.com/foo/bar/... instead of github.com/foo/bar/pkg/B. A helpful error message would have gone a long way

当你在这里时,go 1.11 及更高版本具有内置模块支持。也许考虑转向那个? https://github.com/golang/go/wiki/Modules

关于go - 无法使用 godeps 更新依赖包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54379546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com