mirror of
https://github.com/mgechev/revive.git
synced 2025-02-01 13:07:44 +02:00
ae07914dc4
* ifelse: option to preserve variable scope
16 lines
419 B
Go
16 lines
419 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mgechev/revive/internal/ifelse"
|
|
"github.com/mgechev/revive/lint"
|
|
"github.com/mgechev/revive/rule"
|
|
)
|
|
|
|
// TestSuperfluousElse rule.
|
|
func TestSuperfluousElse(t *testing.T) {
|
|
testRule(t, "superfluous-else", &rule.SuperfluousElseRule{})
|
|
testRule(t, "superfluous-else-scope", &rule.SuperfluousElseRule{}, &lint.RuleConfig{Arguments: []interface{}{ifelse.PreserveScope}})
|
|
}
|