简体   繁体   中英

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?

The go.dev website has some information about this.

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:

  1. Tag the project with a new version number using the git tag command.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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