Hi guys,
I'm having trouble with this too.
My code is as follows:
v := viper.New()
viper.SetConfigName("settings")
viper.SetConfigType("json")
viper.AddConfigPath(".")
v.AutomaticEnv()
err := v.ReadInConfig()
if err != nil {
logrus.Fatal("Fatal error config file: ", e
Ah cool thanks. That did it!
Cheers!
On Monday, September 11, 2017 at 12:12:27 PM UTC+12, Bojan Delic wrote:
>
> You should not use SetConfigFile. Its documentation says:
>
>> SetConfigFile explicitly defines the path, name and extension of the
>> config file.
>> Viper will use this and not che
You should not use SetConfigFile. Its documentation says:
> SetConfigFile explicitly defines the path, name and extension of the
> config file.
> Viper will use this and not check any of the config paths.
You should use SetConfigName instead and pass it "settings", without
extension. Its docume