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
Provenance
- Commit
8eaca5f- Tree
28ab091- Author
umarcor <unai.martinezcorral@ehu.eus>- Committer
Steve Francia <steve.francia@gmail.com>- Parent
ace6b14
6 files changed+5 added−11 removed
modified:cobra/cmd/testdata/root.go.golden+1 added-2 removed
18 unmodified lines19 "fmt"20 "os"21 "github.com/spf13/cobra"22 23- homedir "github.com/mitchellh/go-homedir"23 "github.com/spf13/viper"24 )25 26 var cfgFile string39 unmodified lines66 // 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)72 73 // Search config in home directory with name ".testproject" (without extension).74 viper.AddConfigPath(home)11 unmodified linesmodified:cobra/cmd/root.go+2 added-2 removed
13 unmodified lines14 package cmd15 16 import (17 "fmt"18+ "os"19 19- homedir "github.com/mitchellh/go-homedir"20 "github.com/spf13/cobra"21 "github.com/spf13/viper"22 )23 37 unmodified lines61 // 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)67 68 // Search config in home directory with name ".cobra" (without extension).69 viper.AddConfigPath(home)10 unmodified linesmodified:cobra/tpl/main.go+1 added-2 removed
25 unmodified lines26 "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 )32 33 {{ if .Viper -}}45 unmodified lines79 // 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)85 86 // Search config in home directory with name ".{{ .AppName }}" (without extension).87 viper.AddConfigPath(home)58 unmodified linesmodified:go.mod-1 removed
3 unmodified lines4 5 require (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 lines184 github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=185 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=186 github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=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=188 github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=189 github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=190 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=191 github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=401 unmodified linesmodified:user_guide.md+1 added-2 removed
74 unmodified lines75 import (76 "fmt"77 "os"78 79- homedir "github.com/mitchellh/go-homedir"79 "github.com/spf13/cobra"80 "github.com/spf13/viper"81 )82 37 unmodified lines120 // 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)126 127 // Search config in home directory with name ".cobra" (without extension).128 viper.AddConfigPath(home)509 unmodified lines