英文:
Specifying to contributors what version of go to use in a go project
问题
在Node项目中,package.json
文件可以让贡献者知道他们可以使用哪个版本的Node来消费或贡献给特定项目。Python使用venv
来控制在协作开发环境中使用的版本,许多其他语言也有类似的构建。
Go语言是否有一种标准化的流程,可以让你做类似的事情呢?
英文:
In node projects, package.json
lets contributors know what version of node they can use to either consume or contribute to a specific project. Python uses venv
to control the version used in collaborative development environments, and many other languages have similar constructs as well.
Does go have a standardized process that allows you to do something similar?
答案1
得分: 1
不,但Go语言有一个兼容性的承诺——他们非常努力地不破坏任何建立在1.x版本上的现有软件,即使这样可能会导致不美观的API或不需要的行为(尽管这种情况很少见)。这意味着你不需要担心指定使用哪个版本的Go语言。Go语言2版本甚至还没有出现在视野中,所以在可预见的未来,你不需要担心这个问题。虽然有一些新功能,但大多数Go语言用户都会升级(因为有稳定的升级路径)。
关于你所依赖的库,目前唯一的解决方案是将它们放入vendor文件夹中,但我想你问的是关于语言本身的问题。
英文:
No, but Go has the 1 promise of compatibility - they try very hard not to break any extant software built on 1.x, even at the expense of leaving an ugly API or unwanted behaviour (though this is rare). This means you don't really have to worry about specifying which version of Go you use. Go 2 is not even on the horizon, so for the foreseeable future, you don't have to worry about this. There are a few new features, but most go users upgrade (because of the stable upgrade path).
https://golang.org/doc/go1compat
Re which dependencies you have, at present the only solution is to put your dependencies into a vendor folder, but I think you were asking about the language specifically.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论