Move variable with program name to the top in version.go

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-07-23 07:10:34 -04:00
parent fd8b64768c
commit 56d6e1102d

View File

@ -15,6 +15,9 @@ var (
Suffix: "", Suffix: "",
} }
// The program name
programName = "Portainer Stack Utils"
// commitHash contains the current Git revision. Use Go Releaser to make sure this gets set. // commitHash contains the current Git revision. Use Go Releaser to make sure this gets set.
commitHash string commitHash string
@ -46,8 +49,6 @@ func (v Version) String() string {
} }
func BuildVersionString() string { func BuildVersionString() string {
program := "Portainer Stack Utils"
version := "v" + CurrentVersion.String() version := "v" + CurrentVersion.String()
if commitHash != "" { if commitHash != "" {
@ -61,5 +62,5 @@ func BuildVersionString() string {
date = "unknown" date = "unknown"
} }
return fmt.Sprintf("%s %s %s BuildDate: %s", program, version, osArch, date) return fmt.Sprintf("%s %s %s BuildDate: %s", programName, version, osArch, date)
} }