top | item 37175733 (no title) shinies | 2 years ago Here is an example in the standard library: https://pkg.go.dev/slices discuss order hn newest assbuttbuttass|2 years ago I've used the slices package and I agree it's useful. I was wondering more about generics use in application code shinies|2 years ago Before the slices package you had to write those functions for all your types, it's much better now!I also like using generics for API request/response code, ex: https://go.dev/play/p/OWf9eFmg1qFWith generics you don't need to return any/interface{} / type assert at runtime load replies (1)
assbuttbuttass|2 years ago I've used the slices package and I agree it's useful. I was wondering more about generics use in application code shinies|2 years ago Before the slices package you had to write those functions for all your types, it's much better now!I also like using generics for API request/response code, ex: https://go.dev/play/p/OWf9eFmg1qFWith generics you don't need to return any/interface{} / type assert at runtime load replies (1)
shinies|2 years ago Before the slices package you had to write those functions for all your types, it's much better now!I also like using generics for API request/response code, ex: https://go.dev/play/p/OWf9eFmg1qFWith generics you don't need to return any/interface{} / type assert at runtime load replies (1)
assbuttbuttass|2 years ago
shinies|2 years ago
I also like using generics for API request/response code, ex: https://go.dev/play/p/OWf9eFmg1qF
With generics you don't need to return any/interface{} / type assert at runtime