简体   繁体   English

如何为 Go 项目设置语义版本控制以及设置版本的命令是什么?

[英]How can I set semantic versioning for a Go project and what are commands to set the version?

How can I set semantic versioning for Go project and what are commands to set the version?如何为 Go 项目设置语义版本控制以及设置版本的命令是什么?

The go.dev website has some information about this. go.dev网站有一些关于此的信息。

The "Module version numbering" doc page has information about the versioning standards, and mentions: “模块版本编号”文档页面包含有关版本控制标准的信息,并提到:

If you're developing modules for others to use, you apply a version number when you publish the module, tagging the module in its repository.如果您正在开发供其他人使用的模块,则在发布模块时应用版本号,在其存储库中标记模块。 For more, see Publishing a module .有关更多信息,请参阅发布模块

The "Publishing a module" doc page outlines the steps for publishing your module, including how to set the version number in steps 4 and 5: “发布模块”文档页面概述了发布模块的步骤,包括如何在步骤 4 和 5 中设置版本号:

  1. Tag the project with a new version number using the git tag command.使用 git tag 命令用新版本号标记项目。

For the version number, use a number that signals to users the nature of changes in this release.对于版本号,使用一个数字来向用户表明此版本中更改的性质。 For more, see Module version numbering .有关更多信息,请参阅模块版本编号

 git commit -m "mymodule: changes for v0.1.0" git tag v0.1.0
  1. Push the new tag to the origin repository.将新标签推送到原始存储库。
 git push origin v0.1.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM