mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
Fixed warnings in config package
This commit is contained in:
committed by
Dan Christian Bogos
parent
f9e10fc122
commit
49441b30b6
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user