using tasks and action plans with no accounts

This commit is contained in:
Radu Ioan Fericean
2015-12-17 19:10:38 +02:00
parent 9d228d80bf
commit 65516e201e
13 changed files with 230 additions and 72 deletions

View File

@@ -143,3 +143,20 @@ func (sm StringMap) GetOne() 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
}