Skip to content

Commit

Permalink
Print go version
Browse files Browse the repository at this point in the history
  • Loading branch information
khlieng committed Dec 15, 2018
1 parent 6a816fb commit c5a9a5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion commands/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"log"
"os"
"runtime"

"github.com/khlieng/dispatch/assets"
"github.com/khlieng/dispatch/config"
Expand All @@ -28,6 +29,7 @@ const logo = `
%s
Commit: %s
Build Date: %s
Runtime: %s
`

Expand All @@ -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"))
Expand Down
3 changes: 2 additions & 1 deletion commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package commands

import (
"fmt"
"runtime"

"github.com/khlieng/dispatch/version"
"github.com/spf13/cobra"
Expand All @@ -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())
}

0 comments on commit c5a9a5b

Please sign in to comment.