Given
var dst, src map[K]V
I can copy all entries from src
into dst
by doing
for k, v := range src {
dst[k] = v
}
Is there a more idiomatic way to do this?
copy
only works on slices (and string
as a source).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…