3 ms·
> I probably never would have done it that way, I would probably use an interface type instead I think when you're all in the same package and accessing unexpo
by kodablah 6y ago
> I probably never would have done it that way, I would probably use an interface type instead
I think when you're all in the same package and accessing unexported fields you know about, this is much clearer than an interface. I often add unexported mutually exclusive fields that local code has advanced knowledge about to prevent unnecessary over-abstraction.
- kccqzy 6y agoAnd yeah, and then a new team member doesn't know certain fields are mutually exclusive, and neither does the compiler because of the lack of sum types.