Move version and commit sha into main.go.

pull/1134/head
Ben Johnson 2014-11-17 17:34:47 -07:00
parent 0cc1818eaa
commit f5954ace5e
1 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,12 @@ const logo = `
+---------------------------------------------+ +---------------------------------------------+
` `
// These variables are populated via the Go linker.
var (
version string
commit string
)
func main() { func main() {
if err := start(); err != nil { if err := start(); err != nil {
os.Exit(1) os.Exit(1)
@ -48,7 +54,7 @@ func start() error {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())
flag.Parse() flag.Parse()
v := fmt.Sprintf("InfluxDB v%s (git: %s)", version, gitSha) v := fmt.Sprintf("InfluxDB v%s (git: %s)", version, commit)
if *showVersion { if *showVersion {
fmt.Println(v) fmt.Println(v)
return nil return nil