kube-router/pkg/version/version.go
2021-02-17 09:27:52 +05:30

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)
}
}