MCPcopy
hub / github.com/mmcdole/gofeed / parseLink

Method parseLink

atom/parser.go:574–598  ·  view source on GitHub ↗
(p *xpp.XMLPullParser)

Source from the content-addressed store, hash-verified

572}
573
574func (ap *Parser) parseLink(p *xpp.XMLPullParser) (*Link, error) {
575 if err := p.Expect(xpp.StartTag, "link"); err != nil {
576 return nil, err
577 }
578
579 l := &Link{}
580 l.Href = p.Attribute("href")
581 l.Hreflang = p.Attribute("hreflang")
582 l.Type = p.Attribute("type")
583 l.Length = p.Attribute("length")
584 l.Title = p.Attribute("title")
585 l.Rel = p.Attribute("rel")
586 if l.Rel == "" {
587 l.Rel = "alternate"
588 }
589
590 if err := p.Skip(); err != nil {
591 return nil, err
592 }
593
594 if err := p.Expect(xpp.EndTag, "link"); err != nil {
595 return nil, err
596 }
597 return l, nil
598}
599
600func (ap *Parser) parseCategory(p *xpp.XMLPullParser) (*Category, error) {
601 if err := p.Expect(xpp.StartTag, "category"); err != nil {

Callers 3

parseRootMethod · 0.95
parseEntryMethod · 0.95
parseSourceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected