use log.Fatal instead panic on config errors
This commit is contained in:
parent
2dc0f02d1c
commit
fce1b99683
7 changed files with 22 additions and 28 deletions
|
|
@ -16,6 +16,7 @@ package cmd
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
homedir "github.com/mitchellh/go-homedir"
|
||||
|
|
@ -76,8 +77,7 @@ func initConfig() {
|
|||
// Find home directory.
|
||||
home, err := homedir.Dir()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Search config in home directory with name ".go-base" (without extension).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue