登录
首页 >  Golang >  Go问答

未找到 iris 依赖的 hero 组件

来源:stackoverflow

时间:2024-03-05 09:54:28 151浏览 收藏

学习知识要善于思考,思考,再思考!今天golang学习网小编就给大家带来《未找到 iris 依赖的 hero 组件》,以下内容主要包含等知识点,如果你正在学习或准备学习Golang,就都不要错过本文啦~让我们一起来看看吧,能帮助到你就更好了!

问题内容

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

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

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

后来我使用“dep Ensure -v”下载所有依赖项。

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

所以我不能在我的项目中使用“hero”组件,因为“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 代码

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

为我解决的问题是专门将我想要的包导入到我的代码中,例如:“github.com/jedib0t/go-pretty/table”并再次运行dep ensure -v。我不确定为什么它有效,但也许我的经验可以帮助您或其他人。

今天带大家了解了的相关知识,希望对你有所帮助;关于Golang的技术知识我们会一点点深入介绍,欢迎大家关注golang学习网公众号,一起学习编程~

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>