Skip to content
/ semver Public

A golang implementation of the Semantic Versioning specification

License

Notifications You must be signed in to change notification settings

rokane/semver

Repository files navigation

Build Status Coverage Status Go Report Card License

Semver

A golang Semantic Versioning tool that follows the Semver Specification

This tool can be used as a command line utility or as a golang package for use within other projects.

Installation

go get github.com/rokane/semver

Usage

As a command line utility:

A Golang implementation of the http://semver.org/ specification

Usage: 
semver [options] <version> [<version> [...]]

Options:
-r <range>
        Print versions that match the specified range.

-i <level>
        Increment a version by the specified level. Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, or prerelease. Only one version may be specified.

-preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-build <buildmeta>
        Metadata to be used to attached to the incremented version.

As a golang package:

import "github/rokane/semver"

version := Version{
        Major: 1,
        Minor: 0,
        Patch: 0,
        PreID: "preidentifier"
        BuildMeta: "metadata",
}

// Increment 
version.IncrementMajor()
version.IncrementMinor()
version.IncrementPatch()

// Output to String
version.String()

About

A golang implementation of the Semantic Versioning specification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages