Exhaustive-enum is an exhaustive enum checker for Go. It can be used to make sure you don't miss any cases when switching over an enumeration.
Find switch statements. For each:
- Find type of expression being switched over.
- Verify if the type is an enum:
exhaustive-enum
annotation.- Type has to be a value type (not struct/interface).
- Find all exported values in the package of the type definition.
- Verify that all the enum cases are in the switch, or that there's a default case.