1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-25 14:46:57 +00:00

Util method

This commit is contained in:
Darren Shepherd
2017-12-29 15:09:39 -07:00
parent c61bcaf6c0
commit 2bd0ed6014

17
types/set/reconcile.go Normal file
View File

@@ -0,0 +1,17 @@
package set
func Diff(desired, actual map[string]bool) (toCreate []string, toDelete []string, same []string) {
for key := range desired {
if actual[key] {
same = append(same, key)
} else {
toCreate = append(toCreate, key)
}
}
for key := range actual {
if !desired[key] {
toDelete = append(toDelete, key)
}
}
return
}