英文:
How do I use github packages in go?
问题
抱歉,非常初学者的golang问题。我有一个名为journalbeat的github项目,我正在修改它。
当我克隆该存储库时,我可以设置GOPATH并运行go get
来获取所有的导入包,并将它们放入src目录。
我想添加一个新的导入包。
import "github.com/danwakefield/fnmatch"
但它没有被获取。运行go get
如何确定是否已下载某个包?
最后,使用了供应商系统。我如何将fnmatch添加到供应商目录中?我需要手动创建吗?这一切看起来都很繁琐。
我以为go get
应该使所有这些变得容易?
英文:
Sorry, very much a newbie golang question. I have a github project named journalbeat that I am modifying.
When I clone that repository I can set the GOPATH and run go get
to grab all the imports and it places them into src.
I have a new import I want to add.
import "github.com/danwakefield/fnmatch"
but it doesn't grab it. How does simply running go get
determine whether something is downloaded or not?
And finally, the vendoring system is used. How do I populate that with the fnmatch? do I create it manually? it all seems very cumbersome.
I thought go get was meant to make all this easy?
答案1
得分: 3
尝试使用一个依赖管理器:最新且活跃开发的一个是golang/dep。
根据dep的问题943,使用以下命令:
dep ensure
这将通过导入分析设置供应商依赖项,并且如果需要的话,你可以配置锁定这些依赖项。
英文:
Try instead a dependency manager: the most recent and actively developed one is golang/dep.
Reading dep "issue" 943, use:
dep ensure
That will set up vendored dependencies through import analysis, and you can configure locking those down if need be.
答案2
得分: 0
尝试使用带有详细信息标志-v
的go get
命令,例如:
go get -v github.com/danwakefield/fnmatch
这将显示更多详细信息。请将结果发布在这里。
英文:
Try go get
with the verbose flag -v
like:
go get -v github.com/danwakefield/fnmatch
This will show you more details. Post the result here.
答案3
得分: 0
我们使用Glide包管理工具来管理GO语言的依赖。快去查看吧 GitHub链接
英文:
we use Glide package management tool for GO. Go check it out gitHub link
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论