3 ms·
> (not that someone can't be both, of course) Indeed! I've been writing Go code daily for years. My open source life is just a bit more consumed by Rust these
by burntsushi 10y ago
> (not that someone can't be both, of course)
Indeed! I've been writing Go code daily for years. My open source life is just a bit more consumed by Rust these days. :-)
- infogulch 10y agoFrom the readme: > The go-sumtype command recognizes this pattern, but it needs a small amount of help to recognize which interfaces should be treated as sum types Why is this? Have you tried detecting sum types automatically? Maybe some heuristics like: package-level declaration of the interface, has an unexported method, has more than one type that implements it, maybe also the interface itself is exported.
- burntsushi 10y agoIt seems unwise to do exhaustiveness checks automatically on an interface that "might" be a sum type. The declaration is a single line and has the benefit of being completely unambiguous.