2 ms·
Go switches with exhaustion checks like in [1] would go a long way. An early return construct would be important as well, though, you're right. Go's for loops
by lucian1900 5y ago
Go switches with exhaustion checks like in [1] would go a long way. An early return construct would be important as well, though, you're right.
Go's for loops can only iterate over builtin types: slices, maps, channels, etc. You can't produce a custom type that is to be iterated over.
1. https://github.com/BurntSushi/go-sumtype https://github.com/BurntSushi/go-sumtype