1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00

unused-param,unused-receiver: refactor configure func (#1157)

This commit is contained in:
Oleksandr Redko
2024-12-04 06:55:19 +02:00
committed by GitHub
parent 7f7d024f11
commit 09fb350a27
4 changed files with 47 additions and 32 deletions

View File

@@ -9,6 +9,10 @@ import (
func TestUnusedParam(t *testing.T) {
testRule(t, "unused_param", &rule.UnusedParamRule{})
testRule(t, "unused_param", &rule.UnusedParamRule{}, &lint.RuleConfig{Arguments: []any{}})
testRule(t, "unused_param", &rule.UnusedParamRule{}, &lint.RuleConfig{Arguments: []any{
map[string]any{"a": "^xxx"},
}})
testRule(t, "unused_param_custom_regex", &rule.UnusedParamRule{}, &lint.RuleConfig{Arguments: []any{
map[string]any{"allowRegex": "^xxx"},
}})