laconicd/version/version.go

36 lines
447 B
Go
Raw Normal View History

2021-04-18 16:39:15 +00:00
package version
import (
"fmt"
2022-10-18 10:06:34 +00:00
"runtime" // #nosec G702
2021-04-18 16:39:15 +00:00
)
var (
AppVersion = ""
GitCommit = ""
BuildDate = ""
GoVersion = ""
GoArch = ""
)
func init() {
if len(AppVersion) == 0 {
AppVersion = "dev"
}
GoVersion = runtime.Version()
GoArch = runtime.GOARCH
}
func Version() string {
return fmt.Sprintf(
"Version %s (%s)\nCompiled at %s using Go %s (%s)",
AppVersion,
GitCommit,
BuildDate,
GoVersion,
GoArch,
)
}