Skip to content
Myr

cmd: Fix error message from go-homedir

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Albert Nigmatzianov · committed by Albert Nigmatzianov · parent a28055b · Browse files · 1 file+2 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−5 removed

  • other:+2 added−5 removed

1 file+2 added−5 removed

modified:cobra/cmd/root.go+2 added-5 removed
13 unmodified lines
14package cmd1516import (17 "fmt"18 "os"1819 homedir "github.com/mitchellh/go-homedir"20 "github.com/spf13/cobra"21 "github.com/spf13/viper"
11 unmodified lines
3334// Execute executes the root command.35func Execute() {36 if err := rootCmd.Execute(); err != nil {38 fmt.Println(err)39 os.Exit(1)37 er(err)38 }39}4041func init() {
22 unmodified lines
64 } else {65 // Find home directory.66 home, err := homedir.Dir()67 if err != nil {70 fmt.Println(home)71 os.Exit(1)68 er(err)69 }7071 // Search config in home directory with name ".cobra" (without extension).72 viper.AddConfigPath(home)
9 unmodified lines