Skip to content

hansrodtang/semver

Repository files navigation

Semantic Versioning for Go

Build Coverage Issues License Documentation Chat

A Semantic Versioning library for Go.

❗ Still in heavy development and is not ready for usage. Please wait for the 1.0 release ❗

Covers version 2.0.0 of the semver specification.

Documentation on the syntax for the Satifies() method can be found here.

Installation

  go get github.com/hansrodtang/semver

For those who prefer it, you can also use gopkg.in:

  go get gopkg.in/hansrodtang/semver.v0

Usage

import github.com/hansrodtang/semver

v1, error := semver.New("1.5.0")
// do something with error
if v1.Satisfies("^1.0.0") {
  // do something
}

Benchmarks

Test Iterations Time
BenchmarkParseSimple 5000000 349 ns/op
BenchmarkParseComplex 1000000 1811 ns/op
BenchmarkCompareSimple 500000000 3.85 ns/op
BenchmarkCompareComplex 100000000 17.3 ns/op

Run the benchmarks yourself with:

go test github.com/hansrodtang/semver -bench=.

Tests

Run the tests with:

go test -cover github.com/hansrodtang/semver

License

This software is licensed under the MIT license.

About

A Semantic Versioning library for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages