File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,13 +58,12 @@ func InitViperConfig(configPath string) {
5858 viper .SetConfigFile (configPath )
5959 } else {
6060 // Use default behavior - search for config.yaml in common locations
61- viper .SetConfigName ("config" ) // name of config file (without extension)
62- viper .SetConfigType ("yaml" ) // REQUIRED if the config file does not have the extension in the name
63- viper .AddConfigPath ("." ) // optionally look for config in the working directory
64- viper .AddConfigPath ("/etc/mpcium/" ) // look for config in /etc/mpcium/
61+ viper .SetConfigName ("config" ) // name of config file (without extension)
62+ viper .SetConfigType ("yaml" ) // REQUIRED if the config file does not have the extension in the name
63+ viper .AddConfigPath ("." ) // optionally look for config in the working directory
64+ viper .AddConfigPath ("/etc/mpcium/" ) // look for config in /etc/mpcium/
6565 viper .AddConfigPath ("$HOME/.mpcium/" ) // look for config in home directory
6666 }
67-
6867 viper .SetEnvKeyReplacer (strings .NewReplacer ("." , "_" ))
6968 viper .AutomaticEnv ()
7069 err := viper .ReadInConfig () // Find and read the config file
@@ -74,6 +73,8 @@ func InitViperConfig(configPath string) {
7473
7574 log .Println ("Reading config file:" , viper .ConfigFileUsed ())
7675 log .Println ("Initialized config successfully!" )
76+ log .Println ("Environment" , viper .GetString ("environment" ))
77+ log .Println ("consul.token" , viper .GetString ("consul.token" ))
7778}
7879
7980func LoadConfig () * AppConfig {
You can’t perform that action at this time.
0 commit comments