mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +00:00
Use os.UserHomeDir() in document
This commit is contained in:
parent
9a31ddff0e
commit
f4c3014e5a
1 changed files with 1 additions and 2 deletions
|
@ -213,7 +213,6 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
homedir "github.com/mitchellh/go-homedir"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
@ -239,7 +238,7 @@ func initConfig() {
|
|||
viper.SetConfigFile(cfgFile)
|
||||
} else {
|
||||
// Find home directory.
|
||||
home, err := homedir.Dir()
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
Loading…
Add table
Reference in a new issue