Help us shape the future of Go! Take the 2026 Go Developer Survey

gover

package module
v0.0.0-...-02f331d Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 3 Imported by: 0

README

gover

Simple package with public version variables.

Usage

go get github.com/datainq/gover

Compilation

When compiling the code one should specify the version:

VERSION=v1.0.0
GIT_COMMIT=$(git rev-list -1 HEAD)
BUILD_DATE=$(date +"%s")

go build -ldflags "-X github.com/datainq/gover.GitCommit=$GIT_COMMIT -X github.com/datainq/gover.BuildTime=$BUILD_DATE -X github.com/datainq/gover.Version=$VERSION" main.go

You can import github.com/datainq/gover and use it. The most common use case is to print version at binary startup, help and exit.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GitCommit string
	BuildTime string
	Version   string
)

Functions

func GetBuildTime

func GetBuildTime() time.Time

func GetGitCommitShort

func GetGitCommitShort() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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