Hacker News new | ask | show | jobs
by CamouflagedKiwi 448 days ago
Hmmmm I thought that sharing a common type did work in the way you would expect it to? I haven't tried embedding with it though I don't think.

TBH I rarely do it much anyway, mostly the flag struct ends up being one anonymous struct which is operated on in the main package only. I do like writing custom types for parsing though - I've seen engineers do a bunch of post-hoc parsing logic which generally just ends up being messy.