Allow a configurable env var prefix [#19]
I'd like to keep Prefix's scope fairly limited, because it has potential to spiral into something magnificently complex. You get one prefix setting, it goes in `settings` not `environment`, end of feature.
This commit is contained in:
@@ -42,9 +42,17 @@ func (cfg *Config) Populate() error {
|
||||
return err
|
||||
}
|
||||
|
||||
prefix := cfg.Prefix
|
||||
|
||||
if err := envconfig.Process("", cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if prefix != "" {
|
||||
if err := envconfig.Process(cfg.Prefix, cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user