gover
Provide some simple public version variables.
Install
go get -u github.com/xgfone/gover
Usage
package main
import (
"fmt"
"github.com/xgfone/gover"
)
func main() {
fmt.Println(gover.Text())
}
Build App
You need build your repo with the commands as follow
COMMIT=$(shell git rev-parse HEAD)
VERSION=$(shell git describe --tags)
BUILD_DATE=$(shell date +"%s")
go build -ldflags "-X github.com/xgfone/gover.Commit=$COMMIT -X github.com/xgfone/gover.BuildTime=$BUILD_DATE -X github.com/xgfone/gover.Version=$VERSION"