From d9414968f876c32157dac51cdb73a8351c797197 Mon Sep 17 00:00:00 2001 From: Albert Nigmatzianov Date: Sun, 14 May 2017 12:03:16 +0200 Subject: [PATCH] cmd: Fix error message from go-homedir --- cobra/cmd/root.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cobra/cmd/root.go b/cobra/cmd/root.go index 3e0d5fdd..545cd1ff 100644 --- a/cobra/cmd/root.go +++ b/cobra/cmd/root.go @@ -15,7 +15,6 @@ package cmd import ( "fmt" - "os" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" @@ -35,8 +34,7 @@ to quickly create a Cobra application.`, // Execute executes the root command. func Execute() { if err := rootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) + er(err) } } @@ -67,8 +65,7 @@ func initViper() { // Find home directory. home, err := homedir.Dir() if err != nil { - fmt.Println(home) - os.Exit(1) + er(err) } // Search config in home directory with name ".cobra" (without extension).