Closed montag451 closed 5 days ago
I missed the fact that maps.Clone
return a nil map when the passed map is nil which lead to crashes in some parts of the code so I prefer to close the PR because the benefit of using maps.Clone
is not as high as expected.
Go 1.21 introduced a new
maps
package which provides some utility functions to facilitate some common operations onmap
. One of these functions ismaps.Clone
which eases the cloning of a map. Moreover, themaps.Clone
function is slightly more efficient than manual cloning (cf https://github.com/golang/go/commit/b5a7f2eef7cb17255cb396cd4ff7df04957dd21e)