From 5c00a45aedae17f3607749d0f792d5ca4b4f9078 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 10 Aug 2016 20:01:15 -0400 Subject: [PATCH] Allow version to build without requiring a build tag --- version/version.go | 11 ++++++++--- version/version_base.go | 16 +++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/version/version.go b/version/version.go index b9b650d226..0fb53ae5ba 100644 --- a/version/version.go +++ b/version/version.go @@ -5,9 +5,14 @@ import ( "fmt" ) -// The git commit that was compiled. This will be filled in by the compiler. -var GitCommit string -var GitDescribe string +var ( + // The git commit that was compiled. This will be filled in by the compiler. + GitCommit string + GitDescribe string + + Version string = "unknown" + VersionPrerelease = "unknown" +) // VersionInfo type VersionInfo struct { diff --git a/version/version_base.go b/version/version_base.go index 5003b8e577..2d7fa1087b 100644 --- a/version/version_base.go +++ b/version/version_base.go @@ -1,11 +1,13 @@ -// +build vault +// +build notvault package version -// The main version number that is being run at the moment. -const Version = "0.6.1" +func init() { + // The main version number that is being run at the moment. + Version = "0.6.1" -// A pre-release marker for the version. If this is "" (empty string) -// then it means that it is a final release. Otherwise, this is a pre-release -// such as "dev" (in development), "beta", "rc1", etc. -const VersionPrerelease = "rc2" + // A pre-release marker for the version. If this is "" (empty string) + // then it means that it is a final release. Otherwise, this is a pre-release + // such as "dev" (in development), "beta", "rc1", etc. + VersionPrerelease = "rc2" +}