@@ -252,6 +252,7 @@ type typeInfo struct {
252252 IsPointer bool
253253 IsStdOrBuiltin bool
254254 Deps []Identity
255+ Ty types.Type
255256}
256257
257258// FIXME: for complex type like map[XX]YY , we only extract first-meet type here
@@ -284,7 +285,7 @@ func (ctx *fileContext) mockType(typ ast.Expr) typeInfo {
284285 if err != nil {
285286 goto fallback
286287 }
287- return typeInfo {NewIdentity (mod , PkgPath (impt ), ty .Sel .Name ), false , false , nil }
288+ return typeInfo {NewIdentity (mod , PkgPath (impt ), ty .Sel .Name ), false , false , nil , nil }
288289 case * ast.SelectorExpr :
289290 // recurse
290291 ti := ctx .mockType (xx )
@@ -295,7 +296,7 @@ func (ctx *fileContext) mockType(typ ast.Expr) typeInfo {
295296 }
296297
297298fallback:
298- return typeInfo {NewIdentity ("UNLOADED" , ctx .pkgPath , string (ctx .GetRawContent (typ ))), false , true , nil }
299+ return typeInfo {NewIdentity ("UNLOADED" , ctx .pkgPath , string (ctx .GetRawContent (typ ))), false , true , nil , nil }
299300}
300301
301302func (ctx * fileContext ) collectFields (fields []* ast.Field , m * []Dependency ) {
@@ -453,6 +454,7 @@ func (p *GoParser) collectTypes(ctx *fileContext, typ ast.Expr, st *Type, inline
453454func (ctx * fileContext ) getTypeinfo (typ types.Type ) (ti typeInfo ) {
454455 tobjs , isPointer := getNamedTypes (typ )
455456 ti .IsPointer = isPointer
457+ ti .Ty = typ
456458 if len (tobjs ) > 0 {
457459 tobj := tobjs [0 ]
458460 if tp := tobj .Pkg (); tp != nil {
0 commit comments