[go-nuts] Re: Help with viper please.

2017-10-19 Thread John Episcopo
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

[go-nuts] Re: Help with viper please.

2017-09-10 Thread Tim Uckun
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

[go-nuts] Re: Help with viper please.

2017-09-10 Thread bojan . delic
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