gitex2026/AttackSurface/src/gotestwaf/internal/helpers/utils.go
2026-04-24 12:36:21 +00:00

14 lines
388 B
Go

package helpers
// DeepCopyMap is a generic function to copy a map with any key and value types.
func DeepCopyMap[K comparable, V any](original map[K]V) map[K]V {
// Create a new map to hold the copy
mapCopy := make(map[K]V)
// Iterate over the original map and copy each key-value pair to the new map
for key, value := range original {
mapCopy[key] = value
}
return mapCopy
}