diff --git a/version/version.go b/version/version.go index 05c46e3..9b32a21 100644 --- a/version/version.go +++ b/version/version.go @@ -15,9 +15,9 @@ limitations under the License. */ package version +import "fmt" + var ( - // This variable shows the user any additional changes to files made that aren't on the branch. - GitDirty string // This variable shows the commit hash of the repo so they can confirm they are on latest or specific version of the branch. GitHash string // This variable is dependent on what the current release is e.g. if it is v0.2.3 then this variable, outside of releases, will be v0.2.4-dev . @@ -25,9 +25,5 @@ var ( ) func init() { - if GitDirty != "" && GitHash != "" { - Version += " (" + GitHash + " - " + GitDirty + ")" - } else if GitDirty == "" { - Version += " (" + GitHash + ")" - } + Version = fmt.Sprintf("%s (%s)", Version, GitHash) }