From 3f0f2b342e45d1cd5b416795127da4fe82a273ec Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Fri, 4 Dec 2020 13:04:55 +0800 Subject: [PATCH] Show go version when executes with --version. Signed-off-by: Chin-Ya Huang --- pkg/cli/cmds/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cli/cmds/root.go b/pkg/cli/cmds/root.go index 423b8dce65..f517971651 100644 --- a/pkg/cli/cmds/root.go +++ b/pkg/cli/cmds/root.go @@ -3,6 +3,7 @@ package cmds import ( "fmt" "os" + "runtime" "github.com/rancher/k3s/pkg/version" "github.com/sirupsen/logrus" @@ -33,6 +34,7 @@ func NewApp() *cli.App { app.Version = fmt.Sprintf("%s (%s)", version.Version, version.GitCommit) cli.VersionPrinter = func(c *cli.Context) { fmt.Printf("%s version %s\n", app.Name, app.Version) + fmt.Printf("go version %s\n", runtime.Version()) } app.Flags = []cli.Flag{ DebugFlag,