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

Q: Is there any utility for merge

krishnaTORQUE opened this issue · comments

Is there any utility for merge structs or map or array ?

Thank you @DerkSchooltink
It will be very helpful if you share a code snippet or the utility function name.

commented

you can use an utility like mergo if you are not afraid of reflect.

For a map:

for k, v := range b {
    a[k] = v
}