Hacker News new | ask | show | jobs
by metaltyphoon 283 days ago
> worst case you're getting that struct with all the fields set to zero, and you just have to handle the zero values

In the field I work, zero values are valid and doing it in Go would be a nightmare

2 comments

Database NULL is a valid pattern that any parser SHOULD support and I do consider that a design bug in every parser Go has. Offhand most of them effectively 'update' an object, but make it difficult or impossible to tell if something was __set__ with a value, or merely inherited a default.
Agreed, the pointer or "<field>_empty: bool" patterns are annoying. Point still stands though, you always get the structure you ask for.