[英]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.