Why not? You later seem to think that this would require reflection - but that makes it apparent you don't understand how generics work in a language. They're used at compile time - to avoid runtime checking.
You certainly might use them to write a facade which made life easier for consumers of the math pkg and accept floats,ints or uints even if behind the scenes it splits into different implementations.
Groxx|4 years ago
From https://itnext.io/generics-in-golang-1-18-no-need-to-write-m...
danachow|4 years ago
danachow|4 years ago
grey-area|4 years ago
horsemans|4 years ago
qaq|4 years ago