2020-07-10 14:17:51 +00:00
|
|
|
package misc
|
|
|
|
|
2022-07-08 12:45:21 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
2020-07-24 13:54:03 +00:00
|
|
|
// These variables are changed in compile time.
|
|
|
|
var (
|
2020-07-10 14:17:51 +00:00
|
|
|
// Version is an application version.
|
|
|
|
Version = "dev"
|
|
|
|
)
|
2022-07-08 12:45:21 +00:00
|
|
|
|
|
|
|
// BuildInfo returns human-readable information about this binary.
|
|
|
|
func BuildInfo(component string) string {
|
2022-07-13 14:45:33 +00:00
|
|
|
return fmt.Sprintf("%s\nVersion: %s \nGoVersion: %s\n",
|
2022-07-08 12:45:21 +00:00
|
|
|
component,
|
|
|
|
Version,
|
|
|
|
runtime.Version(),
|
|
|
|
)
|
|
|
|
}
|