1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00
Files
revive/testdata/enforce_switch_style.go

28 lines
424 B
Go

package fixtures
func enforceSwitchStyle3() {
switch expression {
case condition:
default:
}
switch expression {
default: // MATCH /default case clause must be the last one/
case condition:
}
switch expression { // MATCH /switch must have a default case clause/
case condition:
}
// Must not fail when all branches jump
switch expression {
case condition:
break
case condition:
print()
return
}
}