我是Go的新手,但不是软件。我正在开发一个拥有大量项目和依赖项的新团队,因此我们必须使用godep
。
所有代码都是标准Go方式的结构,$GOPATH/.../github.com/...
等文件(包括我们在github中的工作)
我对项目A(github.com/ourTeam/A
)进行了更改,我想运行引用A的项目B(github.com/ourTeam/B
)来测试我的代码。
所以我在A的自己的分支中承诺了我的工作,(甚至推动了分支)。
- > 我想要的是用我的新版本A更新B.
从B开始,我试过了:
godep update github.com/A/subpackage
。它说' godep:没有包可以更新' godep save
。它删除了vendor文件夹中的所有内容,使Godeps.json
文件从任何依赖项中清空Godeps.json
,然后运行godep update。
没有消息,但它没有更新任何东西。此更改后的Godep保存在供应商文件夹和Godep.json 我错过了什么?
注意:我使用godep v65(darwin / amd64 / go1.6.2)和godep save -v
说
godep: Finding dependencies for [.]
godep: Found package: github.com/ourTeam/B
godep: Deps:
(nothing so the diff with old file removes everything)
答案 0 :(得分:0)
您尝试更新时的错误消息告诉我,在B之前,对A的依赖关系尚未被godep保存。这意味着您需要保存它,而不是更新。
今天,我遇到与使用godep save
相同的问题。所有依赖项都被删除了。然而,这让我了解了它:
$ go get -u github.com/tools/godep # Make sure you have the latest godep (currently v71)
$ godep save ./... # Literally, "./..." is the argument
# The above command may fail with "Package not found ..."
# Install any package not found with "go get some/package/path"
$ go get some/package/path # if necessary
# Try "godep save ./..." again; repeat "go get" for any "not found" errors.
一旦godep save
没有错误地返回,我检查并按预期完成。它只添加了我在代码中导入的新依赖项。