In fact, as a general rule, you should always keep things simple even if your tools allow for more complex patterns. These patterns often bite you later. Complexity means you get bugs, challenging maintenance, vendor lock in, scaling issues or perhaps most importantly, the cognitive overhead of having yourself and new engineers understand these complex patterns. Always lean into the few features your tool is advertised to Do Well. This applies equally to your code.
…fect is that even if interface type value holds a nil pointer then such interface value is not nil. Known mistake is to return not initialized, non-interface type value from function returning interf…fect is that even if interface type value holds a nil pointer then such interface value is not nil. Known mistake is to return not initialized, non-interface type value from function returning interface ty…