I’d argue a lot of the ugliness of this is a product of the basic syntax of genetics in go.
The syntax in other languages with generics (C#, Swift, Java, and even c++) for this construct is easy to read. And obviously there’s always Haskell where you often don’t need explicit type annotations at all :D