What's the best way to merge key-value pairs from one map into another in Go? I'm using a simple loop, but I was wondering if there's something like PHP's array_merge
that could be used.
bigmap := map[string]string{"a":"a", "b":"b", "c":"c"}
smallmap := map[string]string{"d":"d"}
for k, v := range smallmap {
bigmap[k] = v
}