This commit is contained in:
Slex 2019-08-11 00:31:22 +03:00
parent ae05683c73
commit 589ad638ea
8 changed files with 47 additions and 33 deletions

22
src/version/version.go Normal file
View file

@ -0,0 +1,22 @@
package version
var buildName string
var buildVersion string
// BuildName gets the current build name. This is usually injected if built
// from git, or returns "unknown" otherwise.
func BuildName() string {
if buildName == "" {
return "yggdrasilctl"
}
return buildName
}
// BuildVersion gets the current build version. This is usually injected if
// built from git, or returns "unknown" otherwise.
func BuildVersion() string {
if buildVersion == "" {
return "unknown"
}
return buildVersion
}