diff options
-rw-r--r-- | main.go | 3 | ||||
-rw-r--r-- | version.go | 10 |
2 files changed, 5 insertions, 8 deletions
@@ -26,9 +26,6 @@ func main() { } if printVersion { - if gitDescribe == "" { - log.Fatal("This build has no version information") - } fmt.Println(gitDescribe) os.Exit(0) } @@ -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 } |