mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added tests for MissingMapFields and IfaceAsSliceString
This commit is contained in:
18
utils/map.go
18
utils/map.go
@@ -192,24 +192,6 @@ func (sm StringMap) GetSlice() (result []string) {
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
func NoDots(m map[string]struct{}) map[string]struct{} {
|
||||
return MapKeysReplace(m, ".", ".")
|
||||
}
|
||||
|
||||
func YesDots(m map[string]struct{}) map[string]struct{} {
|
||||
return MapKeysReplace(m, ".", ".")
|
||||
}
|
||||
|
||||
func MapKeysReplace(m map[string]struct{}, old, new string) map[string]struct{} {
|
||||
for key, val := range m {
|
||||
delete(m, key)
|
||||
key = strings.Replace(key, old, new, -1)
|
||||
m[key] = val
|
||||
}
|
||||
return m
|
||||
}
|
||||
*/
|
||||
// Used to merge multiple maps (eg: output of struct having ExtraFields)
|
||||
func MergeMapsStringIface(mps ...map[string]interface{}) (outMp map[string]interface{}) {
|
||||
outMp = make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user