Emmanuel BENOîT
2fa0e37900
Reviewed-on: #1 Co-authored-by: Emmanuel BENOÎT <tseeker@nocternity.net> Co-committed-by: Emmanuel BENOÎT <tseeker@nocternity.net>
27 lines
421 B
Go
27 lines
421 B
Go
package version // import nocternity.net/gomonop/pkg/version
|
|
|
|
import "fmt"
|
|
|
|
var (
|
|
version = ""
|
|
commit = "unknown"
|
|
status = ""
|
|
target = "unknown/unknown"
|
|
)
|
|
|
|
func Version() 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)
|
|
}
|