Skip to content

synesissoftware/ver2go

Repository files navigation

ver2go

License GitHub release Last Commit Go Go Report Card Go Reference

Version utilities for Go

Introduction

Provides basic version library for use in Go projects.

Table of Contents

Installation

Install via go get, as in:

go get "github.com/synesissoftware/ver2go"

and then import as:

import ver2go "github.com/synesissoftware/ver2go"

or, simply, as:

import "github.com/synesissoftware/ver2go"

Components

The current version of the library consists of the single API function CalcVersionString():

func CalcVersionString(verMajor, verMinor, verPatch, verAB uint16) string

The meaning of the four parameters are:

  • verMajor - the major version;
  • verMinor - the minor version;
  • verPatch - the patch version;
  • verAB - the alpha/beta version;

See the function documentation for details of the rules, but the following examples are illustrative:

ver2go.CalcVersionString(0, 0, 0, 0) // => "0.0.0"
ver2go.CalcVersionString(1, 2, 3, 0xFFFF) // => "1.2.3"
ver2go.CalcVersionString(0, 0, 1, 0x1234) // => "0.0.1.4660"
ver2go.CalcVersionString(0, 1, 2, 0x4321) // => "0.1.2-alpha801"
ver2go.CalcVersionString(0, 1, 0, 0x8765) // => "0.1.0-beta1893"
ver2go.CalcVersionString(1, 2, 3, 0xC007) // => "1.2.3-rc7"

Examples

Examples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/ver2go.

Dependencies

None

Development/Testing Dependencies

Dependents

License

ver2go is released under the 3-clause BSD license. See LICENSE for details.

About

Version helpers 4 Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •