Compare commits

..

No commits in common. "f2c6fce7c90eb86ce8101d3f9e04e55ae80d056d" and "4d3587362501527696d6f9cd02b184a3af2de63c" have entirely different histories.

2 changed files with 9 additions and 13 deletions

View File

@ -6,10 +6,6 @@ import (
"fmt"
)
// It is advisable that each atom:entry element contain a non-empty atom:title
// element, a non-empty atom:content element when that element is present, and
// a non-empty atom:summary element when the entry contains no atom:content
// element.
type Entry struct {
*CommonAttributes
Authors []*Person `xml:"author,omitempty"`
@ -19,10 +15,10 @@ type Entry struct {
ID *ID `xml:"id"`
Links []*Link `xml:"link,omitempty"`
Published *Date `xml:"published,omitempty"`
Rights Text `xml:"rights,omitempty"`
Rights *Text `xml:"rights,omitempty"`
Source *Source `xml:"source,omitempty"`
Summary Text `xml:"summary,omitempty"`
Title Text `xml:"title"`
Summary *Text `xml:"summary,omitempty"`
Title *Text `xml:"title"`
Updated *Date `xml:"updated"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
}
@ -97,7 +93,7 @@ func (e *Entry) Check() error {
}
if e.Rights != nil {
if err := e.Rights.Check(); err != nil {
if err := (*e.Rights).Check(); err != nil {
return fmt.Errorf("rights element of entry %v: %v", e.ID.URI, err)
}
}
@ -109,7 +105,7 @@ func (e *Entry) Check() error {
}
if e.Summary != nil {
if err := e.Summary.Check(); err != nil {
if err := (*e.Summary).Check(); err != nil {
return fmt.Errorf("summary element of entry %v: %v", e.ID.URI, err)
}
}
@ -117,7 +113,7 @@ func (e *Entry) Check() error {
if e.Title == nil {
return fmt.Errorf("no title element of entry %v", e.ID.URI)
} else {
if err := e.Title.Check(); err != nil {
if err := (*e.Title).Check(); err != nil {
return fmt.Errorf("title element of entry %v: %v", e.ID.URI, err)
}
}

View File

@ -26,9 +26,9 @@ type Feed struct {
Entries []*Entry `xml:"entry,omitempty"`
}
// atom:feed elements MUST NOT contain more than one atom:link element with a
// rel attribute value of "alternate" that has the same combination of type and
// hreflang attribute values.
// atom:feed elements MUST NOT contain more than one atom:link
// element with a rel attribute value of "alternate" that has the
// same combination of type and hreflang attribute values.
func hasAlternateDuplicateLinks(l []*Link) bool {
linkMap := make(map[string]bool)