Testing Generics in Go
It’s finally (almost) among us! Finally, after years of hearing that joke “what about Generics?” this long-awaited feature will be available in version 1.18 of the language, scheduled for release in March 2022. In this post, I’ll do an example using Generics and a small benchmark to check if there are any performance differences between a “regular” function and another using this new functionality. To demonstrate this, I will use the library lo, one of the first that uses Generics and that has recently gained prominence for implementing several valuable features for slices and maps....