func done(obj *ast.Object, typ types.Type) { defer os.Exit(0) pos := types.FileSet.Position(types.DeclPos(obj)) fmt.Printf("%v\n", pos) if typ.Kind == ast.Bad || !*tflag { return } fmt.Printf("%s\n", strings.Replace(typeStr(obj, typ), "\n", "\n\t", -1)) if *aflag || *Aflag { var m orderedObjects for obj := range typ.Iter(types.DefaultImporter) { m = append(m, obj) } sort.Sort(m) for _, obj := range m { // Ignore unexported members unless Aflag is set. if !*Aflag && (typ.Pkg != "" || !ast.IsExported(obj.Name)) { continue } id := ast.NewIdent(obj.Name) id.Obj = obj _, mt := types.ExprType(id, types.DefaultImporter) fmt.Printf("\t%s\n", strings.Replace(typeStr(obj, mt), "\n", "\n\t\t", -1)) fmt.Printf("\t\t%v\n", types.FileSet.Position(types.DeclPos(obj))) } } }