• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

semver/H13-Jul-2016-

.travis.ymlH A D13-Jul-201690

LICENSEH A D13-Jul-201611.1 KiB

README.mdH A D13-Jul-2016714

example.goH A D13-Jul-2016329

README.md

1# go-semver - Semantic Versioning Library
2
3[![Build Status](https://travis-ci.org/coreos/go-semver.svg?branch=master)](https://travis-ci.org/coreos/go-semver)
4[![GoDoc](https://godoc.org/github.com/coreos/go-semver/semver?status.svg)](https://godoc.org/github.com/coreos/go-semver/semver)
5
6go-semver is a [semantic versioning][semver] library for Go. It lets you parse
7and compare two semantic version strings.
8
9[semver]: http://semver.org/
10
11## Usage
12
13```go
14vA := semver.New("1.2.3")
15vB := semver.New("3.2.1")
16
17fmt.Printf("%s < %s == %t\n", vA, vB, vA.LessThan(*vB))
18```
19
20## Example Application
21
22```
23$ go run example.go 1.2.3 3.2.1
241.2.3 < 3.2.1 == true
25
26$ go run example.go 5.2.3 3.2.1
275.2.3 < 3.2.1 == false
28```
29