7 ms·
I'm not well versed in golang generics (at $WORK we use go, but not generics yet) but if you want type switches you'll need interface{} to do that https://go.de
by worg 4y ago
I'm not well versed in golang generics (at $WORK we use go, but not generics yet)
but if you want type switches you'll need interface{} to do that
https://go.dev/play/p/1Tn2O_7vCTQ https://go.dev/play/p/1Tn2O_7vCTQ
Which of course defeats the point of using generics
_edit: clarify that my attempt is a bad practice_