// Init populates Config struct with values from config file
// located at filepath and environment variables.
Init populates Config struct with values from config file
located at filepath and environment variables.
// Init populates Config struct with values from config file // located at filepath and environment variables .
func Init(configsDir string) (*Config, error) {
	populateDefaults()
	if err := parseConfigFile(configsDir, os.Getenv("APP_ENV")); err != nil {
		return nil, err
	}
	var cfg Config
	if err := unmarshal(&cfg); err != nil {
		return nil, err
	}
	setFromEnv(&cfg)
	return &cfg, nil
}
func Init ( configsDir string ) ( * Config , error ) { populateDefaults ( ) if err := parseConfigFile ( configsDir , os . Getenv ( " " ) ) ; err != nil { return nil , err } var cfg Config if err := unmarshal ( & cfg ) ; err != nil { return nil , err } setFromEnv ( & cfg ) return & cfg , nil }
Init populates Config struct with values from config file
located at filepath and environment variables.
Init populates Config struct with values from config file located at filepath and environment variables .