From 4805445c9fbc1856e5e396b7abb5ccaad08be13c Mon Sep 17 00:00:00 2001 From: bemasher Date: Thu, 20 Sep 2018 18:23:03 -0600 Subject: [PATCH] Fix version flags for use with goreleaser. --- main.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 91d86911b..a90c4c52f 100644 --- a/main.go +++ b/main.go @@ -225,8 +225,9 @@ func init() { } var ( - buildDate string // date -u '+%Y-%m-%d' - commitHash string // git rev-parse HEAD + buildTag = "dev" // v#.#.# + buildDate = "unknown" // date -u '+%Y-%m-%d' + commitHash = "unknown" // git rev-parse HEAD ) func main() { @@ -237,14 +238,9 @@ func main() { rcvr.HandleFlags() if *version { - if buildDate == "" || commitHash == "" { - fmt.Println("Built from source.") - fmt.Println("Build Date: Unknown") - fmt.Println("Commit: Unknown") - } else { - fmt.Println("Build Date:", buildDate) - fmt.Println("Commit: ", commitHash) - } + fmt.Println("Build Tag: ", buildTag) + fmt.Println("Build Date:", buildDate) + fmt.Println("Commit: ", commitHash) os.Exit(0) }