Being confused about when to use generics
Introduction The Go 1.18 release introduced a new feature called generic types (commonly known by the shorter term, generics). This allows writing code with types that can be specified later and instantiated when needed. However, it can be confusing about when to use generics and when not to. In this blog, I will try to describe the concept…
Comparing values incorrectly
In software development comparing values between fields is a common operation. Writing a function to compare two objects, and testing to compare a value to the expected result are some of the frequently implemented comparisons. While comparing our first insight might be to use the == operator everywhere. But this should not always be the…