From c5a9a5b1c159fca63b8203a125320f52a2cdd412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Sat, 15 Dec 2018 11:30:29 +0100 Subject: [PATCH] Print go version --- commands/dispatch.go | 4 +++- commands/version.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/dispatch.go b/commands/dispatch.go index 07fd2e1c..8a5a97b1 100644 --- a/commands/dispatch.go +++ b/commands/dispatch.go @@ -5,6 +5,7 @@ import ( "io/ioutil" "log" "os" + "runtime" "github.com/khlieng/dispatch/assets" "github.com/khlieng/dispatch/config" @@ -28,6 +29,7 @@ const logo = ` %s Commit: %s Build Date: %s + Runtime: %s ` @@ -41,7 +43,7 @@ var rootCmd = &cobra.Command{ } if cmd == cmd.Root() { - fmt.Printf(logo, version.Tag, version.Commit, version.Date) + fmt.Printf(logo, version.Tag, version.Commit, version.Date, runtime.Version()) } storage.Initialize(viper.GetString("dir")) diff --git a/commands/version.go b/commands/version.go index e16833ed..168a75b6 100644 --- a/commands/version.go +++ b/commands/version.go @@ -2,6 +2,7 @@ package commands import ( "fmt" + "runtime" "github.com/khlieng/dispatch/version" "github.com/spf13/cobra" @@ -17,5 +18,5 @@ var versionCmd = &cobra.Command{ } func printVersion() { - fmt.Printf("%s\nCommit: %s\nBuild Date: %s\n", version.Tag, version.Commit, version.Date) + fmt.Printf("%s\nCommit: %s\nBuild Date: %s\nRuntime: %s\n", version.Tag, version.Commit, version.Date, runtime.Version()) }