Skip to content
Myr

drop mitchellh/go-homedir (#853)

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

authored by umarcor · committed by Steve Francia · parent ace6b14 · Browse files · 6 files+5 added−11 removed
This commit

State

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

Diff stats

6 files+5 added−11 removed

  • other:+5 added−11 removed

6 files+5 added−11 removed

modified:cobra/cmd/testdata/root.go.golden+1 added-2 removed
18 unmodified lines
19 "fmt"20 "os"21 "github.com/spf13/cobra"2223 homedir "github.com/mitchellh/go-homedir"23 "github.com/spf13/viper"24)2526var cfgFile string
39 unmodified lines
66 // Use config file from the flag.67 viper.SetConfigFile(cfgFile)68 } else {69 // Find home directory.71 home, err := homedir.Dir()70 home, err := os.UserHomeDir()71 cobra.CheckErr(err)7273 // Search config in home directory with name ".testproject" (without extension).74 viper.AddConfigPath(home)
11 unmodified lines
modified:cobra/cmd/root.go+2 added-2 removed
13 unmodified lines
14package cmd1516import (17 "fmt"18 "os"1919 homedir "github.com/mitchellh/go-homedir"20 "github.com/spf13/cobra"21 "github.com/spf13/viper"22)23
37 unmodified lines
61 // Use config file from the flag.62 viper.SetConfigFile(cfgFile)63 } else {64 // Find home directory.65 home, err := homedir.Dir()65 home, err := os.UserHomeDir()66 cobra.CheckErr(err)6768 // Search config in home directory with name ".cobra" (without extension).69 viper.AddConfigPath(home)
10 unmodified lines
modified:cobra/tpl/main.go+1 added-2 removed
25 unmodified lines
26 "fmt"27 "os"28 "github.com/spf13/cobra"29{{ if .Viper }}30 homedir "github.com/mitchellh/go-homedir"30 "github.com/spf13/viper"{{ end }}31)3233{{ if .Viper -}}
45 unmodified lines
79 // Use config file from the flag.80 viper.SetConfigFile(cfgFile)81 } else {82 // Find home directory.84 home, err := homedir.Dir()83 home, err := os.UserHomeDir()84 cobra.CheckErr(err)8586 // Search config in home directory with name ".{{ .AppName }}" (without extension).87 viper.AddConfigPath(home)
58 unmodified lines
modified:go.mod-1 removed
3 unmodified lines
45require (6 github.com/cpuguy83/go-md2man/v2 v2.0.07 github.com/inconshreveable/mousetrap v1.0.08 github.com/mitchellh/go-homedir v1.1.08 github.com/spf13/pflag v1.0.59 github.com/spf13/viper v1.8.010 gopkg.in/yaml.v2 v2.4.011)
modified:go.sum-2 removed
183 unmodified lines
184github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=185github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=186github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=187github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=188github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=189github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=188github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=189github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=190github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=191github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
401 unmodified lines
modified:user_guide.md+1 added-2 removed
74 unmodified lines
75import (76 "fmt"77 "os"7879 homedir "github.com/mitchellh/go-homedir"79 "github.com/spf13/cobra"80 "github.com/spf13/viper"81)82
37 unmodified lines
120 // Use config file from the flag.121 viper.SetConfigFile(cfgFile)122 } else {123 // Find home directory.125 home, err := homedir.Dir()124 home, err := os.UserHomeDir()125 cobra.CheckErr(err)126127 // Search config in home directory with name ".cobra" (without extension).128 viper.AddConfigPath(home)
509 unmodified lines