27 lines
379 B
Go
27 lines
379 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
var (
|
|
version = ""
|
|
commit = "unknown"
|
|
status = ""
|
|
target = "unknown/unknown"
|
|
)
|
|
|
|
func versionString() string {
|
|
var schar, ver string
|
|
if status == "dirty" {
|
|
schar = "*"
|
|
} else {
|
|
schar = ""
|
|
}
|
|
|
|
if version == "" {
|
|
ver = "development version"
|
|
} else {
|
|
ver = version
|
|
}
|
|
|
|
return fmt.Sprintf("%s (%s%s) %s", ver, commit, schar, target)
|
|
}
|