Semantic versioning (http://semver.org/) for Go. Full support of the 2.0 spec.
Just use go get.
go get gopkg.in/typerandom/semver.v1
And then just import the package into your own code.
import (
"gopkg.in/typerandom/semver.v1"
)
package main
import (
"fmt"
"gopkg.in/typerandom/semver.v1"
)
func main() {
version := semver.New("1.0.0")
fmt.Printf("Version is: v%d.%d.%d", version.Major(), version.Minor(), version.Patch())
}
For full documentation see GoDoc.
Semver is licensed under the MIT license. See LICENSE for the full license text.