mirror of
https://github.com/spf13/cobra
synced 2024-12-29 15:57:10 +00:00
cmd: Fix error message from go-homedir
This commit is contained in:
parent
a28055bed2
commit
d9414968f8
1 changed files with 2 additions and 5 deletions
|
@ -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).
|
||||
|
|
Loading…
Reference in a new issue