nandlabs / go-commons

A common collection of utilities for Go programming language
Apache License 2.0
2 stars 2 forks source link

Create a Semver package #4

Closed nandagopalan closed 1 year ago

nandagopalan commented 1 year ago

Create a package to parse and compare Semantic versioning as specified in https://semver.org

nandagopalan commented 1 year ago

The main requirement here is to

  1. Ability to parse a semver
  2. Compare 2 Semver ( return +ve for greater, -ve for smaller and 0 for equal)
  3. Get Next
    • Major Version
    • Minor Version
    • Patch Version
  4. Is Pre Release
  5. Support semver with both "v" and non "v" prefix ( v1.0.3 =1.0.3) for both parsing and writing.