|
|
|
|
|
by sidlls
1324 days ago
|
|
Yup. Go desperately needs a sum type with compiler-enforced matching on all possible cases. And errors need to be such a type. Long before Rust I used to implement this (to the extent possible) with templates in C++ when I'd start work on a new code base, if it didn't exist. With generics added to Go I might start the same at my current role. It's too bad there aren't other tools to support it (e.g. macros). |
|