我对 Go 很陌生;但我对另一个库“ https://github.com/jedib0t/go-pretty ”也有类似的问题
$ dep ensure -add github.com/jedib0t/go-pretty
"github.com/jedib0t/go-pretty" is not imported by your project, and has been temporarily added to Gopkg.lock and vendor/.
If you run "dep ensure" again before actually importing it, it will disappear from Gopkg.lock and vendor/.
该 repo 被克隆到pkg/dep/sources/https---github.com-jedib0t-go--pretty/
但是没有 Go 代码vendor/github.com/jedib0t/go-pretty/
"github.com/jedib0t/go-pretty"
我在我的一个源代码文件中添加了一个导入并运行,dep ensure -v
但是供应商副本没有任何 Go 代码。我删除了文件夹并再次尝试,但结果相同。
为我解决的问题是专门将我想要的包导入到我的代码中,例如:"github.com/jedib0t/go-pretty/table"
然后dep ensure -v
再次运行。我不确定它为什么会起作用,但也许我的经验可以帮助您或其他人。