Fixed warnings in config package

This commit is contained in:
porosnicuadrian
2021-03-31 11:45:04 +03:00
committed by Dan Christian Bogos
parent f9e10fc122
commit 49441b30b6
2 changed files with 3 additions and 3 deletions

View File

@@ -1282,7 +1282,7 @@ func (cfg *CGRConfig) loadCfgWithLocks(path, section string) (err error) {
loadFuncs = append(loadFuncs, loadMap[sec])
}
} else if fnct, has := loadMap[section]; !has {
return fmt.Errorf("Invalid section: <%s>", section)
return fmt.Errorf("Invalid section: <%s> ", section)
} else {
cfg.lks[section].Lock()
defer cfg.lks[section].Unlock()
@@ -1355,7 +1355,7 @@ func (cfg *CGRConfig) loadConfigFromFolder(cfgDir string, loadFuncs []func(jsnCf
return
}
if !jsonFilesFound {
return fmt.Errorf("No config file found on path %s", cfgDir)
return fmt.Errorf("No config file found on path %s ", cfgDir)
}
return
}

View File

@@ -5732,7 +5732,7 @@ func TestCallOnCGRConfig(t *testing.T) {
}
func TestLoadCfgFromJSONWithLocksInvalidSeciton(t *testing.T) {
expected := "Invalid section: <invalidSection>"
expected := "Invalid section: <invalidSection> "
cfg := NewDefaultCGRConfig()
if err = cfg.loadCfgWithLocks("/random/path", "invalidSection"); err == nil || err.Error() != expected {
t.Errorf("Expected %+v, received %+v", expected, err)