xgfone / gover

Supply some simple public version variables.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gover GoDoc License

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"

Or, use the shell script build.sh or the Makefile.

About

Supply some simple public version variables.

License:Apache License 2.0


Languages

Language:Go 69.8%Language:Makefile 16.7%Language:Shell 13.6%