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:
18
testdata/enforce_switch_style.go
vendored
Normal file
18
testdata/enforce_switch_style.go
vendored
Normal 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:
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user