File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments