1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/test/receiver-naming_test.go
chavacava 53a111d36e
adds check for receiver names length (#1048)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
Co-authored-by: yuta nishiyama <57400690+ytnsym@users.noreply.github.com>
2024-09-23 12:38:39 +02:00

25 lines
605 B
Go

package test
import (
"testing"
"github.com/mgechev/revive/internal/typeparams"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestReceiverNamingTypeParams(t *testing.T) {
if !typeparams.Enabled() {
t.Skip("type parameters are not enabled in the current build environment")
}
testRule(t, "receiver-naming-issue-669", &rule.ReceiverNamingRule{})
}
func TestReceiverNamingMaxLength(t *testing.T) {
args := []any{map[string]any{
"maxLength": int64(2),
}}
testRule(t, "receiver-naming-issue-1040", &rule.ReceiverNamingRule{},
&lint.RuleConfig{Arguments: args})
}