1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-27 22:18:41 +02:00

feature: new rule enforce-switch-default (#1390)

This commit is contained in:
chavacava
2025-06-01 09:57:47 +02:00
committed by GitHub
parent 6becd540e4
commit cfd69439bb
10 changed files with 328 additions and 0 deletions

18
testdata/enforce_switch_style.go vendored Normal file
View File

@@ -0,0 +1,18 @@
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:
}
}