(p *Package, obj *types.TypeName)
| 82 | } |
| 83 | |
| 84 | func newStruct(p *Package, obj *types.TypeName) (*Struct, error) { |
| 85 | sym := p.syms.symtype(obj.Type()) |
| 86 | if sym == nil { |
| 87 | return nil, fmt.Errorf("no such object [%s] in symbols table", obj.Id()) |
| 88 | } |
| 89 | sym.doc = p.getDoc("", obj) |
| 90 | s := &Struct{ |
| 91 | pkg: p, |
| 92 | sym: sym, |
| 93 | obj: obj, |
| 94 | } |
| 95 | return s, nil |
| 96 | } |
| 97 | |
| 98 | func (s *Struct) Obj() *types.TypeName { |
| 99 | return s.obj |