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

Do we commit vendor folder changes?

WBOY
WBOYforward
2024-02-05 23:36:131057browse

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!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete
Previous article:Dockerfile package toNext article:Dockerfile package to