lint
Signed-off-by: blob42 <contact@blob42.xyz>
This commit is contained in:
parent
ac6819ec94
commit
857e7625db
@ -132,12 +132,12 @@ func GetModuleOption(module string, opt string) (interface{}, error) {
|
||||
return nil, fmt.Errorf("module %s not found", module)
|
||||
}
|
||||
|
||||
// Regiser a module option ie. under [module] in toml file
|
||||
// If the module is not a configurator, a simple map[string]interface{} will be
|
||||
// created for it.
|
||||
|
||||
// TODO: check if generics can be used here to avoid interface{} type
|
||||
// TODO: add support for option description that can be used in cli help
|
||||
|
||||
// Register a module option ie. under [module] in toml file
|
||||
// If the module is not a configurator, a simple map[string]interface{} will be
|
||||
// created for it.
|
||||
func RegisterModuleOpt(module string, opt string, val interface{}) error {
|
||||
log.Debugf("Setting option for module <%s>: %s = %v", module, opt, val)
|
||||
if _, ok := configs[module]; !ok {
|
||||
@ -149,9 +149,6 @@ func RegisterModuleOpt(module string, opt string, val interface{}) error {
|
||||
return err
|
||||
}
|
||||
|
||||
//DEBUG:
|
||||
// watchAll, _ := configs[module].Get("WatchAllProfiles")
|
||||
// log.Debugf("[%s]WATCH_ALL: %v", module, watchAll)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -121,15 +121,13 @@ func LoadFromTomlFile() error {
|
||||
return fmt.Errorf("loading config file %w", err)
|
||||
}
|
||||
|
||||
//DEBUG:
|
||||
// fmt.Println("Mem Config Keys:")
|
||||
// for k, _ := range configs {
|
||||
// fmt.Printf("%#v\n", k)
|
||||
// }
|
||||
|
||||
for k, val := range buffer {
|
||||
// fmt.Println("File Config Keys:")
|
||||
// fmt.Printf("%#v\n", k)
|
||||
|
||||
// send the conf to its own module
|
||||
if _, ok := configs[k]; !ok {
|
||||
log.Debugf("creating module config [%s]", k)
|
||||
@ -143,9 +141,10 @@ func LoadFromTomlFile() error {
|
||||
|
||||
}
|
||||
|
||||
log.Debugf("loaded config from %s\n", configFile)
|
||||
log.Debugf("config file %#v\n", buffer)
|
||||
log.Debugf("loaded config %#v", configs)
|
||||
//DEBUG:
|
||||
// log.Debugf("loaded config from %s\n", configFile)
|
||||
// log.Debugf("config file %#v\n", buffer)
|
||||
// log.Debugf("loaded config %#v", configs)
|
||||
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user