summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go3
-rw-r--r--version.go10
2 files changed, 5 insertions, 8 deletions
diff --git a/main.go b/main.go
index 4a45586..7b65bf4 100644
--- a/main.go
+++ b/main.go
@@ -26,9 +26,6 @@ func main() {
}
if printVersion {
- if gitDescribe == "" {
- log.Fatal("This build has no version information")
- }
fmt.Println(gitDescribe)
os.Exit(0)
}
diff --git a/version.go b/version.go
index c3cc266..94ee141 100644
--- a/version.go
+++ b/version.go
@@ -1,13 +1,13 @@
package main
-import "fmt"
+import (
+ "log"
+)
var gitDescribe string
-func version() (string, error) {
+func init() {
if gitDescribe == "" {
- return "", fmt.Errorf("No version information available")
+ log.Fatal("No version information passed to this via build flags")
}
-
- return gitDescribe, nil
}