Probably like this: https://gist.github.com/ParthDesai/5e0f1d4725a644f1e632
Wow. That seems very complicated for an implementation of map().
It seems like this is a perfect example of how generics are a productivity feature.
It's complicated because the reflect library is very general. There's no need to repeat most of this. So in fact, it's a perfect example of how functions are a productivity feature.
OK. How do you implement array.map() in Golang?