Simplifies the version formatter.

This commit is contained in:
James Phillips 2016-07-19 15:15:26 -07:00
parent d982af63fd
commit 40e433358e
1 changed files with 3 additions and 4 deletions

View File

@ -31,14 +31,13 @@ func GetVersion() string {
release = "dev" release = "dev"
} }
fullVersion := fmt.Sprintf("%s", version)
if release != "" { if release != "" {
fullVersion += fmt.Sprintf("-%s", release) version += fmt.Sprintf("-%s", release)
if GitCommit != "" { if GitCommit != "" {
fullVersion += fmt.Sprintf(" (%s)", GitCommit) version += fmt.Sprintf(" (%s)", GitCommit)
} }
} }
// Strip off any single quotes added by the git information. // Strip off any single quotes added by the git information.
return strings.Replace(fullVersion, "'", "", -1) return strings.Replace(version, "'", "", -1)
} }