Version utilities for Go
Provides basic version library for use in Go projects.
Install via go get
, as in:
go get "github.com/synesissoftware/ver2go"
and then import as:
import ver2go "github.com/synesissoftware/ver2go"
or, simply, as:
import "github.com/synesissoftware/ver2go"
The current version of the library consists of the single API function CalcVersionString()
:
func CalcVersionString(verMajor, verMinor, verPatch, verAB uint16) string
The meaning of the four parameters are:
verMajor
- the major version;verMinor
- the minor version;verPatch
- the patch version;verAB
- the alpha/beta version;
See the function documentation for details of the rules, but the following examples are illustrative:
ver2go.CalcVersionString(0, 0, 0, 0) // => "0.0.0"
ver2go.CalcVersionString(1, 2, 3, 0xFFFF) // => "1.2.3"
ver2go.CalcVersionString(0, 0, 1, 0x1234) // => "0.0.1.4660"
ver2go.CalcVersionString(0, 1, 2, 0x4321) // => "0.1.2-alpha801"
ver2go.CalcVersionString(0, 1, 0, 0x8765) // => "0.1.0-beta1893"
ver2go.CalcVersionString(1, 2, 3, 0xC007) // => "1.2.3-rc7"
Examples are provided in the examples
directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/ver2go.
None
- ANGoLS;
- CLASP.Go;
- CLiC4.Go;
- Diagnosticism.Go;
- libpath.Go;
- libCLImate.Go;
- recls.Go;
- shwild.Go;
- STEGoL;
- to-be.Go;
ver2go is released under the 3-clause BSD license. See LICENSE for details.