News for hackers. Stuff that matters.
Re:Go nulls and SQL by throwaway894345 on Monday May 23, 2022 @05:27PM (#31484965)
It's generally useful, not just in SQL. Any time you have a type that could be multiple things, you have to choose between a reference-based implementation (e.g., interfaces) or a tagged struct (a struct with a flag field that tells you what its runtime type). The tagged struct version is guaranteed not to allocate, while the interface version very likely will. Most of the time it will only matter if you're in a tight loop.

There are no comments on this comment yet.