Vendor a Dependency in Go
In Go, vendor refers to the process of including copies of a project's dependencies within the project itself, making them independent of the Go module repository. When a dependency is vendored, its source code is stored alongside the project's code.
Definition from the Go 1.5 Vendor Experiment
The Go 1.5 Vendor Experiment describes vendoring 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.
Usage in Example
Dependencies that are vendored with your application
In this example, "vendored" means that the dependencies referenced by the application are included within the application's codebase.
Relationship to Ruby Vendoring
The term "vendoring" in Go is not directly related to its usage in Ruby. In Ruby, vendoring refers to a specific gem vendor mechanism that was introduced in Ruby Gems 3.2.0.
Conventional Definition vs. Go 1.5 Definition
The term "vendoring" is not fully defined outside of the Go 1.5 Vendor Experiment. However, the concept of vendoring as described in the experiment has become widely accepted as a convention within the Go community.
The above is the detailed content of What is Vendoring in Go and How Does it Differ from Other Languages?. For more information, please follow other related articles on the PHP Chinese website!