Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
A Google search for golang sum types currently shows my project as a second hit: https://github.com/BurntSushi/go-sumtype
I tried to find that linter and found this: exhaustive
Really, the way Go interfaces silently collapse is unthinkably insane if you really look at it, and the only mitigation is that we just accept the idea that interfaces can never change once they're first created, which leads to other insane design choices like http.ResponseController, a stark admission that interface evolution is impossible, and a precedent that other interfaces are likely to follow.
You can write a linter that checks for exhaustiveness. I wrote a proof-of-concept some time ago: https://github.com/loov/enumcheck... so probably doesn't work with generics.