gpt4 book ai didi

go - 我需要将 gopkg.lock 添加到 Git 吗?

转载 作者:IT王子 更新时间:2023-10-29 01:01:12 25 4
gpt4 key购买 nike

鉴于:

The manifest describes user intent, and the lock describes computed outputs. There's flexibility in manifests that isn't present in locks..., as the "branch": "master" constraint will match whatever revision master HAPPENS to be at right now, whereas the lock is nailed down to a specific revision.

This flexibility is important because it allows us to provide easy commands (e.g. dep ensure -update) that can manage an update process for you, within the constraints you specify, AND because it allows your project, when imported by someone else, to collaboratively specify the constraints for your own dependencies.

引用:https://github.com/golang/dep/blob/master/docs/FAQ.md

最佳答案

是的,为了确保可重现的构建

There's flexibility in manifests that isn't present in locks..., as the "branch": "master" constraint will match whatever revision master HAPPENS to be at right now, whereas the lock is nailed down to a specific revision.

任何使用锁定文件克隆您的 Go 项目存储库的人都将获得依赖项的确切 SHA1。
您仍然可以随时更新该锁定文件,并对其更新内容进行版本控制。

关于go - 我需要将 gopkg.lock 添加到 Git 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51738797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com