英文:
Package management with go vendoring
问题
你好!以下是你要翻译的内容:
如何使用Go的vendoring功能?很多地方都提到1.6版本现在包含了vendoring功能,但我找不到任何文档?
当我使用go get
命令时,我没有看到vendor文件夹?
我只是想像npm、apt等工具一样能够控制包。
英文:
How do you use go vendoring. It is written many places that 1.6 now include vendoring, but I can not find any documentation?
When use go get
, I see no vendor folder?
I just need to be able to control packages like npm, apt etc.
答案1
得分: 3
从1.5版本开始(通过一个标志)和1.6版本默认情况下,Go工具将在vendor
文件夹中查找依赖包,然后才查找你的GOPATH
,具体细节请参考设计文档。
但是Go工具本身并不包含用于填充vendor
文件夹的工具。
有许多工具可以尝试为你处理这个问题,例如Godep、gvt等。
你仍然需要使用go get
将包获取到你的GOPATH
中。
英文:
As of 1.5 (with a flag) and 1.6 by default the go tools will look in the vendor
folder for dependant packages before your GOPATH
, for specifics see the design doc
But the go tools do not include tooling to populate that folder for you.
There are many tools that try to handle it for you, for example Godep, gvt and others.
You still need to use go get
to get the packages into your GOPATH
first.
2: https://github.com/tools/godep "Godep"
3: https://github.com/FiloSottile/gvt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论