File tree 6 files changed +5
-11
lines changed
6 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ package cmd
15
15
16
16
import (
17
17
"fmt"
18
+ "os"
18
19
19
- homedir "github.com/mitchellh/go-homedir"
20
20
"github.com/spf13/cobra"
21
21
"github.com/spf13/viper"
22
22
)
@@ -62,7 +62,7 @@ func initConfig() {
62
62
viper .SetConfigFile (cfgFile )
63
63
} else {
64
64
// Find home directory.
65
- home , err := homedir . Dir ()
65
+ home , err := os . UserHomeDir ()
66
66
cobra .CheckErr (err )
67
67
68
68
// Search config in home directory with name ".cobra" (without extension).
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import (
20
20
"os"
21
21
"github.com/spf13/cobra"
22
22
23
- homedir "github.com/mitchellh/go-homedir"
24
23
"github.com/spf13/viper"
25
24
)
26
25
@@ -68,7 +67,7 @@ func initConfig() {
68
67
viper.SetConfigFile(cfgFile)
69
68
} else {
70
69
// Find home directory.
71
- home, err := homedir.Dir ()
70
+ home, err := os.UserHomeDir ()
72
71
cobra.CheckErr(err)
73
72
74
73
// Search config in home directory with name ".testproject" (without extension).
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import (
27
27
"os"
28
28
"github.com/spf13/cobra"
29
29
{{ if .Viper }}
30
- homedir "github.com/mitchellh/go-homedir"
31
30
"github.com/spf13/viper"{{ end }}
32
31
)
33
32
@@ -81,7 +80,7 @@ func initConfig() {
81
80
viper.SetConfigFile(cfgFile)
82
81
} else {
83
82
// Find home directory.
84
- home, err := homedir.Dir ()
83
+ home, err := os.UserHomeDir ()
85
84
cobra.CheckErr(err)
86
85
87
86
// Search config in home directory with name ".{{ .AppName }}" (without extension).
Original file line number Diff line number Diff line change 5
5
require (
6
6
github.com/cpuguy83/go-md2man/v2 v2.0.0
7
7
github.com/inconshreveable/mousetrap v1.0.0
8
- github.com/mitchellh/go-homedir v1.1.0
9
8
github.com/spf13/pflag v1.0.5
10
9
github.com/spf13/viper v1.8.0
11
10
gopkg.in/yaml.v2 v2.4.0
Original file line number Diff line number Diff line change @@ -185,8 +185,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
185
185
github.com/miekg/dns v1.0.14 /go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg =
186
186
github.com/mitchellh/cli v1.0.0 /go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc =
187
187
github.com/mitchellh/go-homedir v1.0.0 /go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0 =
188
- github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y =
189
- github.com/mitchellh/go-homedir v1.1.0 /go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0 =
190
188
github.com/mitchellh/go-testing-interface v1.0.0 /go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI =
191
189
github.com/mitchellh/gox v0.4.0 /go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg =
192
190
github.com/mitchellh/iochan v1.0.0 /go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY =
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ import (
76
76
" fmt"
77
77
" os"
78
78
79
- homedir " github.com/mitchellh/go-homedir"
80
79
" github.com/spf13/cobra"
81
80
" github.com/spf13/viper"
82
81
)
@@ -122,7 +121,7 @@ func initConfig() {
122
121
viper.SetConfigFile (cfgFile)
123
122
} else {
124
123
// Find home directory.
125
- home , err := homedir. Dir ()
124
+ home , err := os. UserHomeDir ()
126
125
cobra.CheckErr (err)
127
126
128
127
// Search config in home directory with name ".cobra" (without extension).
You can’t perform that action at this time.
0 commit comments