使用Go的供应商管理进行软件包管理

huangapple go评论80阅读模式
英文:

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文件夹的工具。

有许多工具可以尝试为你处理这个问题,例如Godepgvt等。

你仍然需要使用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

huangapple
  • 本文由 发表于 2016年3月5日 22:02:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/35815054.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定