3 ms·
This is only a small piece of the story for what people say when they want tagged unions. Without all of the ancillary support in the language, like exhaustive
by mirashii 2mo ago
This is only a small piece of the story for what people say when they want tagged unions. Without all of the ancillary support in the language, like exhaustive pattern matching, it really doesn't count.
- Splizard 2mo agoYou can also add support for exhaustive switches on tags.
- catlifeonmars 2mo agoJust as a linter config though?
- Splizard 2mo agoNo, by leveraging unkeyed struct initializers as the switch case pattern, which the Go compiler does exhaustiveness checking on.