Update version string building

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-09 01:39:01 -04:00
parent a6a4a70996
commit dd8e928698

View File

@ -21,16 +21,15 @@ var (
)
func BuildVersionString() string {
osArch := runtime.GOOS + "/" + runtime.GOARCH
if version == "" {
return fmt.Sprintf("%s SNAPSHOT %s", programName, osArch)
}
if commitHash != "" {
version += "+" + strings.ToUpper(commitHash)
}
osArch := runtime.GOOS + "/" + runtime.GOARCH
date := buildDate
if date == "" {
date = "unknown"
}
return fmt.Sprintf("%s %s %s BuildDate: %s", programName, version, osArch, date)
return fmt.Sprintf("%s %s %s BuildDate: %s", programName, version, osArch, buildDate)
}