mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Decouple modules from global config
Rather than referencing wtc.Config, instead pass the global config Also, look up config for the module early and pass that in sooner, to deal with fewer long paths and get rid of the ConfigKey variable
This commit is contained in:
@@ -11,9 +11,9 @@ type Settings struct {
|
||||
common *cfg.Common
|
||||
}
|
||||
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config) *Settings {
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromYAML(name, configKey, ymlConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, ymlConfig, globalConfig),
|
||||
}
|
||||
|
||||
return &settings
|
||||
|
||||
Reference in New Issue
Block a user