(path string)
| 15 | } |
| 16 | |
| 17 | func LoadConfig(path string) (*conf, error) { |
| 18 | var cfg *conf |
| 19 | viper.SetConfigName("app_config") |
| 20 | viper.SetConfigType("env") |
| 21 | viper.AddConfigPath(path) |
| 22 | viper.SetConfigFile(".env") |
| 23 | viper.AutomaticEnv() |
| 24 | err := viper.ReadInConfig() |
| 25 | if err != nil { |
| 26 | panic(err) |
| 27 | } |
| 28 | err = viper.Unmarshal(&cfg) |
| 29 | if err != nil { |
| 30 | panic(err) |
| 31 | } |
| 32 | return cfg, err |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected