cmd: Fix error message from go-homedir
This commit is contained in:
		@ -15,7 +15,6 @@ package cmd
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	homedir "github.com/mitchellh/go-homedir"
 | 
						homedir "github.com/mitchellh/go-homedir"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
@ -35,8 +34,7 @@ to quickly create a Cobra application.`,
 | 
				
			|||||||
// Execute executes the root command.
 | 
					// Execute executes the root command.
 | 
				
			||||||
func Execute() {
 | 
					func Execute() {
 | 
				
			||||||
	if err := rootCmd.Execute(); err != nil {
 | 
						if err := rootCmd.Execute(); err != nil {
 | 
				
			||||||
		fmt.Println(err)
 | 
							er(err)
 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -67,8 +65,7 @@ func initViper() {
 | 
				
			|||||||
		// Find home directory.
 | 
							// Find home directory.
 | 
				
			||||||
		home, err := homedir.Dir()
 | 
							home, err := homedir.Dir()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			fmt.Println(home)
 | 
								er(err)
 | 
				
			||||||
			os.Exit(1)
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Search config in home directory with name ".cobra" (without extension).
 | 
							// Search config in home directory with name ".cobra" (without extension).
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user