3 ms·
It’s the lack of generics that makes code reuse hard in Go.
by perfmode 8y ago
It’s the lack of generics that makes code reuse hard in Go.
- sethammons 8y agoIt is true that Go doesn't lend itself to general packages often. You are either left with interface{} parameters and return values (bye bye compile time type check) or working against an interface like the ol' sort package. That said, I've only run up against this a couple of times in multiple years of working in the language, and it so happens that caching is one of them.