Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "vendoring" mean in Go?

Tags:

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:

  • Is this related to vendoring in Ruby?

  • Is this term fully defined in the Go 1.5 Vendor Experiment, or is there a separate conventional definition?

like image 363
djsmith Avatar asked Jan 31 '16 01:01

djsmith


1 Answers

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.

like image 82
Snowman Avatar answered Sep 19 '22 04:09

Snowman