versioning

package module
v0.0.0-...-3f0e695 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2017 License: MIT Imports: 2 Imported by: 6

README

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:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() string

Get returns the version.

func Set

func Set(v string)

Set sets the version.

func Write

func Write(w io.Writer)

Write the version to a writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL