diff options
author | Runxi Yu <me@runxiyu.org> | 2025-01-02 20:04:43 +0000 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-01-02 20:04:43 +0000 |
commit | 9d5eb3f7818f5a0b1dc9655c80b2adf1f2c00b2c (patch) | |
tree | 96cd54b20d34b166a6828d3f00600c8b6e6e41e8 /misc/misc.go | |
parent | clog: Add fatal (diff) | |
download | go-lindenii-common-9d5eb3f7818f5a0b1dc9655c80b2adf1f2c00b2c.tar.gz go-lindenii-common-9d5eb3f7818f5a0b1dc9655c80b2adf1f2c00b2c.tar.zst go-lindenii-common-9d5eb3f7818f5a0b1dc9655c80b2adf1f2c00b2c.zip |
Map copy
Diffstat (limited to '')
-rw-r--r-- | misc/misc.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 + } +} |