thoas / go-funk

A modern Go utility library which provides helpers (map, find, contains, filter, ...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implements Union

samber opened this issue · comments

Merge 2 map:

a := map[string]string{
   "hello": "world",
   "foo": "bar",
}

b := map[string]string{
   "key": "value",
   "foo": "BAR",
}

funk.Union(a, b)

Returning:

map[string]string{
   "hello": "world",
   "foo": "BAR",
   "key": "value",
}
commented

use mergo, it does the job and it does it well :)