Skip to content

Commit

Permalink
chore(util): add DeepCopyIntToStringMap to util
Browse files Browse the repository at this point in the history
  • Loading branch information
luomingmeng committed Feb 10, 2025
1 parent ef280c4 commit bd3fb22
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/util/general/deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,15 @@ func DeepCopyIntToInt64Map(origin map[int]int64) map[int]int64 {
}
return res
}

func DeepCopyIntToStringMap(origin map[int]string) map[int]string {
if origin == nil {
return nil
}

res := make(map[int]string, len(origin))
for key, val := range origin {
res[key] = val
}
return res
}

0 comments on commit bd3fb22

Please sign in to comment.