“vendoring” 在 Go 语言中是什么意思?

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

What does "vendoring" mean in Go?

问题

在学习Go语言的依赖管理时,我经常听到“vendor”这个词被用作动词。例如:“你的应用程序所依赖的库被vendored了……”

在这个上下文中,"vendor a dependency"是什么意思?

例子:

"Dependencies that are vendored with your application"(与你的应用程序一起打包的依赖项)

来源:https://devcenter.heroku.com/articles/getting-started-with-go#declare-app-dependencies

"godep will write the vendored code"(godep将会生成vendored代码)

来源:https://github.com/tools/godep#go-15-vendor-experiment

后续问题:

  • 这与Ruby中的"vendoring"有关吗?

  • 这个术语在Go 1.5 Vendor Experiment中有完整的定义,还是有单独的传统定义?

英文:

When learning about Go's dependency management, I often hear the term "vendor" used as a verb. Example: "The dependencies that your application vendors..."

What does it mean to vendor a dependency in this context?


Examples:

> "Dependencies that are vendored with your application"

Source: https://devcenter.heroku.com/articles/getting-started-with-go#declare-app-dependencies

> "godep will write the vendored code"

Source: https://github.com/tools/godep#go-15-vendor-experiment


Follow-up questions:

答案1

得分: 34

在Go语言中,这里定义了以下内容:

Vendoring是将第三方包的副本存储在项目中并保存在项目仓库中的行为。

我对Ruby一无所知。

基本上,你将一个包存储在自己的项目中,并使用该版本进行构建。我将其类比为构建网页时,将第三方的CSS或JS放在一个名为“vendors”的文件夹中。

英文:

Defined here for Go as:

> Vendoring is the act of making your own copy of the 3rd party packages
> your project is using. Those copies are traditionally placed inside
> each project and then saved in the project repository.

I don't know squirt about Ruby.

Essentially you're taking a package, storing it within your own project and using that version to build from. I liken it to how you might have a "vendors" folder where you put third party css or js when building a web page.

huangapple
  • 本文由 发表于 2016年1月31日 09:40:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/35109393.html
匿名

发表评论

匿名网友

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

确定