Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coreos/go-semver
semver library in Go
https://github.com/coreos/go-semver
Last synced: 11 days ago
JSON representation
semver library in Go
- Host: GitHub
- URL: https://github.com/coreos/go-semver
- Owner: coreos
- License: apache-2.0
- Created: 2013-07-26T03:01:53.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T21:11:00.000Z (5 months ago)
- Last Synced: 2024-05-09T12:57:25.756Z (about 1 month ago)
- Language: Go
- Homepage: http://semver.org
- Size: 58.6 KB
- Stars: 336
- Watchers: 19
- Forks: 54
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Lists
- go-awesome - go-semver - 语义版本 (开源类库 / 未归类)
- awesome-stars - coreos/go-semver - semver library in Go (Go)
- go-awesome - go-semver - Semantic versioning (Open source library / Not Categorized)
README
# go-semver - Semantic Versioning Library
[![GoDoc](https://godoc.org/github.com/coreos/go-semver/semver?status.svg)](https://godoc.org/github.com/coreos/go-semver/semver)
go-semver is a [semantic versioning][semver] library for Go. It lets you parse
and compare two semantic version strings.[semver]: http://semver.org/
## Usage
```go
vA := semver.New("1.2.3")
vB := semver.New("3.2.1")fmt.Printf("%s < %s == %t\n", vA, vB, vA.LessThan(*vB))
```## Example Application
```
$ go run example.go 1.2.3 3.2.1
1.2.3 < 3.2.1 == true$ go run example.go 5.2.3 3.2.1
5.2.3 < 3.2.1 == false
```