github.com/docker/compose-on-kubernetes@v0.5.0/api/compose/clone/maps.go (about) 1 package clone 2 3 // MapOfStringToSliceOfString deep copy a map[string][]string 4 func MapOfStringToSliceOfString(source map[string][]string) map[string][]string { 5 if source == nil { 6 return nil 7 } 8 res := make(map[string][]string, len(source)) 9 for k, v := range source { 10 res[k] = SliceOfString(v) 11 } 12 return res 13 } 14 15 // MapOfStringToInt deep copy a map[string]int 16 func MapOfStringToInt(source map[string]int) map[string]int { 17 if source == nil { 18 return nil 19 } 20 res := make(map[string]int, len(source)) 21 for k, v := range source { 22 res[k] = v 23 } 24 return res 25 }