File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,12 @@ func main() {
84
84
_type = "[]" + v .Elt .(* ast.Ident ).Name
85
85
case * ast.StarExpr :
86
86
switch x := elt .X .(type ) {
87
+ case * ast.Ident :
88
+ _type = "[]" + "*" + packageName + "." + x .Name
87
89
case * ast.SelectorExpr :
88
90
_type = "[]" + "*" + x .X .(* ast.Ident ).Name + "." + x .Sel .Name
89
91
default :
90
- panic (fmt .Sprintf ("unsupported array type: %T" , elt ))
92
+ panic (fmt .Sprintf ("unsupported array type: %T" , x ))
91
93
}
92
94
}
93
95
case * ast.StarExpr :
@@ -124,6 +126,8 @@ func main() {
124
126
break
125
127
}
126
128
_type = "..." + selectorExpr .X .(* ast.Ident ).Name + "." + selectorExpr .Sel .Name
129
+ case * ast.Ident :
130
+ _type = v .Name
127
131
default :
128
132
log .Fatalf ("unsupported param type: %T" , field .Type )
129
133
}
@@ -146,6 +150,8 @@ func main() {
146
150
switch x := elt .X .(type ) {
147
151
case * ast.SelectorExpr :
148
152
_type = "[]" + "*" + x .X .(* ast.Ident ).Name + "." + x .Sel .Name
153
+ case * ast.Ident :
154
+ _type = "[]" + "*" + packageName + "." + x .Name
149
155
default :
150
156
panic (fmt .Sprintf ("unsupported array type: %T" , elt ))
151
157
}
You can’t perform that action at this time.
0 commit comments