mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Update version string building
This commit is contained in:
@ -21,16 +21,15 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BuildVersionString() string {
|
func BuildVersionString() string {
|
||||||
|
osArch := runtime.GOOS + "/" + runtime.GOARCH
|
||||||
|
|
||||||
|
if version == "" {
|
||||||
|
return fmt.Sprintf("%s SNAPSHOT %s", programName, osArch)
|
||||||
|
}
|
||||||
|
|
||||||
if commitHash != "" {
|
if commitHash != "" {
|
||||||
version += "+" + strings.ToUpper(commitHash)
|
version += "+" + strings.ToUpper(commitHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
osArch := runtime.GOOS + "/" + runtime.GOARCH
|
return fmt.Sprintf("%s %s %s BuildDate: %s", programName, version, osArch, buildDate)
|
||||||
|
|
||||||
date := buildDate
|
|
||||||
if date == "" {
|
|
||||||
date = "unknown"
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Sprintf("%s %s %s BuildDate: %s", programName, version, osArch, date)
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user