From 9d5eb3f7818f5a0b1dc9655c80b2adf1f2c00b2c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 2 Jan 2025 20:04:43 +0000 Subject: Map copy --- misc/misc.go | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 misc/misc.go diff --git a/misc/misc.go b/misc/misc.go new file mode 100644 index 0000000..df849a0 --- /dev/null +++ b/misc/misc.go @@ -0,0 +1,7 @@ +package misc + +func Copy_map[K comparable, V any](dst map[K]V, src map[K]V) { + for k, v := range src { + dst[k] = v + } +} -- cgit v1.2.3