mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-17 22:16:07 +00:00
Implement feature from https://github.com/yggdrasil-network/yggdrasil-go/issues/488
This commit is contained in:
22
src/version/version.go
Normal file
22
src/version/version.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user