如何在测试包中使用 godep?

huangapple go评论94阅读模式
英文:

How do I use godep with testing packages

问题

我刚刚开始第一次使用godep。当我运行godep save时,Godeps.json文件中没有包含我的单元测试所依赖的testify

go get -t命令可以获取到testify,我该如何告诉godep将我的测试依赖项包含进去呢?

英文:

I have just started using godep for the first time. When I ran godep save, the Godeps.json file did not include testify which is a dependency for my unit tests.

go get -t would see testify, how do I tell godep to include my test dependencies?

答案1

得分: 3

godep会自动保存测试依赖项。在我的情况下,测试位于内部包中,所以我只需要运行godep save ./...而不是godep save,然后testify会被正常找到。

英文:

godep saves test dependencies automatically. In my case, the tests were in an inner package, so I only needed to run godep save ./... instead of godep save and testify was found as expected.

huangapple
  • 本文由 发表于 2014年4月3日 04:03:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/22821840.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定