func newStruct(p *Package, obj *types.TypeName) (Struct, error) { sym := p.syms.symtype(obj.Type()) if sym == nil { panic(fmt.Errorf("no such object [%s] in symbols table", obj.Id())) } sym.doc = p.getDoc("", obj) s := Struct{ pkg: p, sym: sym, obj: obj, } return s, nil }