package
0.0.0-20211113074651-c6ea6ab4ee08
Repository: https://github.com/tsaikd/kdgolib.git
Documentation: pkg.go.dev

# README

KDGoLib version package

Usage

  • import package
import "github.com/tsaikd/KDGoLib/version"
  • initialize version
func init() {
	version.VERSION = "0.0.1"
}
  • show version in somewhere
func main() {
	fmt.Println(version.String())
}
  • config LDFLAGS when compile time
githash="$(git rev-parse HEAD | cut -c1-8)"
buildtime="$(date +%Y-%m-%d)"

LDFLAGS="${LDFLAGS} -X github.com/tsaikd/KDGoLib/version.BUILDTIME ${buildtime}"
LDFLAGS="${LDFLAGS} -X github.com/tsaikd/KDGoLib/version.GITCOMMIT ${githash}"

go build -ldflags "${LDFLAGS}"

# Packages

No description provided by the author

# Functions

Get return Version info.
JSON return version info with JSON format.
String return version info with string format.

# Variables

exported variables.
exported variables.
exported variables.
exported variables.
exported variables.

# Structs

Version contains info for Get response.