buildvers

package module
Version: v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Unlicense Imports: 3 Imported by: 4

README

Build Versioning

This project can be used to automatically include versioning and build information in your binaries.

Features

  • Binary name
  • Version according to git tags
  • Build hash
  • Build time

Usage

You can take a look at git.elyxon.de/tobikris/go-sample for usage hints. The important places to look at are the Makefile and cmd/sample/sample.go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Binary name
	Binary string
	// Version of binary
	Version string
	// Build number of binary
	Build string
	// BuildTime of binary
	BuildTime string
)

Functions

func PrintVersion

func PrintVersion()

PrintVersion will print the compiled-in version strings

func SprintVersion

func SprintVersion() string

SprintVersion will return the compiled-in version strings

Types

type Buildvers

type Buildvers struct {
	Binary    string
	Version   string
	Build     string
	BuildTime time.Time
}

func Construct

func Construct(binary, version, build, buildtime string) Buildvers

Construct constructs a Buildvers from the arguments

func GetVersion

func GetVersion() Buildvers

GetVersion will return the compiled-in version data

func (Buildvers) GetVersion

func (bv Buildvers) GetVersion() Buildvers

GetVersion will return the version data of the receiver

func (Buildvers) PrintVersion

func (bv Buildvers) PrintVersion()

PrintVersion will print the version strings of the receiver

func (Buildvers) SprintVersion

func (bv Buildvers) SprintVersion() string

SprintVersion will return the version strings of the receiver

Source Files

Jump to

Keyboard shortcuts

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