Does it make sense to add `go mod vendor` to a pre-commit hook?

拈花ヽ惹草 提交于 2021-02-07 10:59:35

问题


Setup:

  • Our project is using golang 1.12.14
  • We are using go build -mod=vendor

Issue: When new dependencies are added to go.mod the vendor folder isn't updated and people are committing code and forgetting to run go mod vendor to update the folder. My understanding is that since -mod=vendor specifies to use packages from the vendor folder, the go.mod file will have discrepancies from what we are actually using when building the project.

Question: Should go mod vendor be added to a pre-commit hook?

来源:https://stackoverflow.com/questions/61531189/does-it-make-sense-to-add-go-mod-vendor-to-a-pre-commit-hook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!