Annotate individual switches
egonelbre opened this issue · comments
Egon Elbre commented
Sometimes it makes more sense to annotate every exhaustive switch separately.
Egon Elbre commented
Fixed with 8aa7b78
//enumcheck:silent
type Option string
var (
Alpha = Option("alpha")
Beta = Option("beta")
)
func NoErrorHere() {
var day Option
switch day {
case Beta:
fmt.Println("beta")
}
}
func EnablePerSwitch() {
var day Option
switch day { //enumcheck:exhaustive
case Beta:
fmt.Println("beta")
}
}