Hacker News new | ask | show | jobs
by LOLOLOLO1 2703 days ago
"oneof" construction is here for two reasons:

1. It enhances readability 2. It would be a surprise to you: oneof actually enhances type safety. It is just lacking type system of Go where you cannot express the feature and thus loses type safety.