An open API service indexing awesome lists of open source software.

https://github.com/datainq/gover

Super simple package to put your git commit hash, version and build timestamp
https://github.com/datainq/gover

Last synced: 8 months ago
JSON representation

Super simple package to put your git commit hash, version and build timestamp

Awesome Lists containing this project

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.