2016-06-15 14:50:35 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2016-06-20 09:47:10 -05:00
|
|
|
)
|
2016-06-15 14:50:35 -05:00
|
|
|
|
2016-08-07 23:09:13 +03:00
|
|
|
var (
|
2016-09-08 12:45:12 +03:00
|
|
|
gitCommit = "rely on linker: -ldflags -X main.GitCommit"
|
|
|
|
buildStamp = "rely on linker: -ldflags -X main.buildStamp"
|
2016-09-21 15:22:42 +03:00
|
|
|
|
|
|
|
versionMajor = 0 // Major version component of the current release
|
|
|
|
versionMinor = 9 // Minor version component of the current release
|
2016-09-28 21:30:45 +03:00
|
|
|
versionPatch = 1 // Patch version component of the current release
|
2016-09-21 15:22:42 +03:00
|
|
|
versionMeta = "unstable" // Version metadata to append to the version string
|
2016-08-07 23:09:13 +03:00
|
|
|
)
|
|
|
|
|
2016-06-20 10:21:45 -05:00
|
|
|
func main() {
|
2016-09-21 15:22:42 +03:00
|
|
|
verString := fmt.Sprintf("%d.%d.%d", versionMajor, versionMinor, versionPatch)
|
|
|
|
if versionMeta != "" {
|
|
|
|
verString += "-" + versionMeta
|
|
|
|
}
|
|
|
|
if gitCommit != "" {
|
|
|
|
verString += "-" + gitCommit[:8]
|
|
|
|
}
|
|
|
|
fmt.Printf("Status\nGit Commit: %s\nBuild Time: %s\nVersion: %s\n", gitCommit, buildStamp, verString)
|
2016-06-20 10:21:45 -05:00
|
|
|
}
|