func mergeMaps()

in webhooks/alloydb-nodeselector-mwh/handlers/pod_nodeselector_handler.go [163:176]


func mergeMaps(existing, new map[string]string) map[string]string {

	result := make(map[string]string)
	for k, val := range existing {
		result[k] = val
	}
	for k, val := range new {
		if _, ok := result[k]; !ok { // Don't overwrite but only add unique keys
			result[k] = val
		}
	}
	return result

}