Omit Atom feed Author from xml when it is not specified.

This commit is contained in:
Eddie Scholtz
2016-02-06 20:43:20 -08:00
parent 30e5c6fc6d
commit e0fc054fec
+1 -3
View File
@@ -78,7 +78,7 @@ type AtomFeed struct {
Rights string `xml:"rights,omitempty"` // copyright used
Subtitle string `xml:"subtitle,omitempty"`
Link *AtomLink
Author *AtomAuthor // required
Author *AtomAuthor `xml:"author,omitempty"`
Contributor *AtomContributor
Entries []*AtomEntry
}
@@ -145,8 +145,6 @@ func (a *Atom) AtomFeed() *AtomFeed {
}
if a.Author != nil {
feed.Author = &AtomAuthor{AtomPerson: AtomPerson{Name: a.Author.Name, Email: a.Author.Email}}
} else {
feed.Author = &AtomAuthor{AtomPerson: AtomPerson{Name: "", Email: ""}}
}
for _, e := range a.Items {
feed.Entries = append(feed.Entries, newAtomEntry(e))