3 ms·
My personal experience with generics was to port a parallel circular queue library (used to take interface{} and require a type cast at every use) add an experi
by sudhirj 5y ago
My personal experience with generics was to port a parallel circular queue library (used to take interface{} and require a type cast at every use) add an experiment to build all the Lodash slice and collection functions in Go.
Happy to say that both worked really well. Took me less than an hour to understand the system enough for these purposes, and the implementation hides neatly in the library - the code that uses the library has absolutely no mention of anything generic. Having generics also helped switch to cleaner implementation inside as well, because I could now use maps as well without type casts.
Looks like a solid useful system - I could do everything I wanted, all the complexity stays in the library, and changes were pretty minimal and easy to understand. Would recommend.
https://github.com/sudhirj/cirque https://github.com/sudhirj/cirque
https://github.com/sudhirj/slicy https://github.com/sudhirj/slicy