Home > Backend Development > Golang > Do we commit vendor folder changes?

Do we commit vendor folder changes?

WBOY
Release: 2024-02-05 23:36:13
forward
1101 people have browsed it

Do we commit vendor folder changes?

Question content

I want to understand the vendor folder in the Go project.

I cloned a go repository and changed the code. But when I try to run the relevant tests, I get some error messages. After some googling I found out that I need to run some commands:

  • Organization module

  • Go to module supplier

Now the problem is gone, but I see a lot of files changed in the vendor folder.

is it acceptable?

Do I need to submit all these documents?


Correct answer


vendor folder contains all dependencies for the project and therefore is not typically committed to the repository.

However, you should commit the go.mod and go.sum files if the library you depend on doesn't have anything sketchy (remove versions, sources, etc.) ## The #vendor folder should be fully reproducible from the go.sum file.

For Go modules, the

vendor folder is rarely used. Most people don't use it natively either. Running go mod download instead of go modvendor will download the module into the modules directory on your system (default is $GOPATH/pkg).

You can read more about the provider using the Go module in the

documentation. Or view the entire Go module documentation https://www.php.cn/link/28538c394c36e4d5ea8ff5ad60562a93.

The above is the detailed content of Do we commit vendor folder changes?. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template