Skip to content

Commit 6089e06

Browse files
committed
fix: split TestGenerateTypeNameByExp_FuncType to satisfy funlen lint rule
1 parent ae68d85 commit 6089e06

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

plugins/core/instrument/enhance_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ func TestGenerateTypeNameByExp_FuncType(t *testing.T) {
5353
}{
5454
{
5555
"func with no params no results",
56-
&dst.FuncType{
57-
Params: &dst.FieldList{},
58-
},
56+
&dst.FuncType{Params: &dst.FieldList{}},
5957
"func()",
6058
},
6159
{
@@ -113,6 +111,20 @@ func TestGenerateTypeNameByExp_FuncType(t *testing.T) {
113111
},
114112
"func(context.Context, *primitive.SendResult, error)",
115113
},
114+
}
115+
for _, tt := range tests {
116+
t.Run(tt.name, func(t *testing.T) {
117+
assert.Equal(t, tt.expected, generateTypeNameByExp(tt.expr))
118+
})
119+
}
120+
}
121+
122+
func TestGenerateTypeNameByExp_FuncType_NamedFields(t *testing.T) {
123+
tests := []struct {
124+
name string
125+
expr dst.Expr
126+
expected string
127+
}{
116128
{
117129
"func with named params ignores names",
118130
&dst.FuncType{

0 commit comments

Comments
 (0)