From https://itnext.io/generics-in-golang-1-18-no-need-to-write-m...
Is this one better? It does run and doesn't rely on casting (not sure why GP's source took that route, it was lossy and kind of dumb). I suspect the compilation problem was because of a change in the syntax between when that was created and today.