From 857e7625db6166b0de6a0ba062f928a157b81ed5 Mon Sep 17 00:00:00 2001 From: blob42 Date: Thu, 10 Oct 2024 18:21:41 +0200 Subject: [PATCH] lint Signed-off-by: blob42 --- pkg/config/config.go | 11 ++++------- pkg/config/config_file.go | 11 +++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0c1df2f..0bcbaa3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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 } diff --git a/pkg/config/config_file.go b/pkg/config/config_file.go index 808a981..16ba6cf 100644 --- a/pkg/config/config_file.go +++ b/pkg/config/config_file.go @@ -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 }