Simplifies the version formatter.

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

View File

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