tonglil / versioning

A library to make set/get/writing versioning information easier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Versioning

A library to make set/get/writing versioning information easier.

Installation

Use go get:

go get -u github.com/tonglil/versioning

Usage

  1. Add in main.go:

    var version string
    
    func init() {
        versioning.Set(version)
    }
  2. Where you want to get the version:

    version := versioning.Get()
    // or
    versioning.Write(os.Stdout)
  3. Build your binary with this flag:

    go build -ldflags "-X main.version=123-up-to-you"

Development

Roadmap:

About

A library to make set/get/writing versioning information easier

License:MIT License


Languages

Language:Go 100.0%