fix home directory config not loading (#1282)

leverage `viper.SetConfigType("yaml")` to fix issue regarding home directory configuration failing to load.
This commit is contained in:
Rob Playford 2021-06-16 02:52:13 +01:00 committed by GitHub
parent 4590150168
commit 9a432671fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 0 deletions

View File

@ -246,6 +246,7 @@ func initConfig() {
// Search config in home directory with name ".cobra" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".cobra")
}

View File

@ -67,6 +67,7 @@ func initConfig() {
// Search config in home directory with name ".cobra" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".cobra")
}

View File

@ -73,6 +73,7 @@ func initConfig() {
// Search config in home directory with name ".testproject" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".testproject")
}

View File

@ -86,6 +86,7 @@ func initConfig() {
// Search config in home directory with name ".{{ .AppName }}" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".{{ .AppName }}")
}