Home > Backend Development > Golang > What is Vendoring in Go and How Does it Differ from Other Languages?

What is Vendoring in Go and How Does it Differ from Other Languages?

Barbara Streisand
Release: 2024-11-29 09:49:14
Original
905 people have browsed it

What is Vendoring in Go and How Does it Differ from Other Languages?

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template