mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-11-21 13:01:16 +01:00
24 lines
431 B
Go
24 lines
431 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
|
|
"github.com/golang/glog"
|
|
)
|
|
|
|
// Version and BuildDate are injected at build time via ldflags
|
|
var Version string
|
|
var BuildDate string
|
|
|
|
func PrintVersion(logOutput bool) {
|
|
output := fmt.Sprintf("Running %v version %s, built on %s, %s\n", os.Args[0], Version, BuildDate, runtime.Version())
|
|
|
|
if !logOutput {
|
|
fmt.Fprintf(os.Stderr, "%s", output)
|
|
} else {
|
|
glog.Info(output)
|
|
}
|
|
}
|