繁体   English   中英

使用“ dep”管理项目依赖项时未安装iris的“ hero”组件

[英]the “hero” component of iris not installed when using “dep” to manage project dependencies

这个问题也发布在这里: https : //github.com/kataras/iris/issues/1081

我在golang项目中使用“ iris”作为MVC框架,并使用“ dep”管理项目的依赖项。

在“ Gopkg.toml”中将“ iris”依赖项配置如下:

在此处输入图片说明

在此处输入图片说明

之后,我使用“ dep sure -v”下载所有依赖项。

“确保”命令完成后,我检查“ vendor / github.com / kataras / iris / hero”文件夹中的下载文件,发现没有下载源代码文件,请参见下面的截屏:

在此处输入图片说明

因此我无法在项目中使用“英雄”组件,因为与项目中未安装的“英雄”相关的软件包。

在此处输入图片说明

谢谢大家的帮助〜

我是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/.

回购被克隆到pkg/dep/sources/https---github.com-jedib0t-go--pretty/但是vendor/github.com/jedib0t/go-pretty/没有Go代码

我在我的一个源代码文件中添加了一个导入"github.com/jedib0t/go-pretty" ,并运行dep ensure -v "github.com/jedib0t/go-pretty" dep ensure -v但是供应商副本没有任何Go代码。 我删除了文件夹,然后再次尝试了相同的结果。

为我解决的是专门将我想要的软件包导入到我的代码中,例如: "github.com/jedib0t/go-pretty/table"然后再次运行dep ensure -v "github.com/jedib0t/go-pretty/table" dep ensure -v 我不确定为什么会奏效,但也许我的经验可以为您或其他人提供帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM