mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-19 08:41:02 -04:00
843aebf2c1
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
25 lines
561 B
Go
25 lines
561 B
Go
package clone
|
|
|
|
// MapOfStringToSliceOfString deep copy a map[string][]string
|
|
func MapOfStringToSliceOfString(source map[string][]string) map[string][]string {
|
|
if source == nil {
|
|
return nil
|
|
}
|
|
res := make(map[string][]string, len(source))
|
|
for k, v := range source {
|
|
res[k] = SliceOfString(v)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// MapOfStringToInt deep copy a map[string]int
|
|
func MapOfStringToInt(source map[string]int) map[string]int {
|
|
if source == nil {
|
|
return nil
|
|
}
|
|
res := make(map[string]int, len(source))
|
|
for k, v := range source {
|
|
res[k] = v
|
|
}
|
|
return res
|
|
}
|