Compare commits
2 Commits
4d35873625
...
f2c6fce7c9
Author | SHA1 | Date | |
---|---|---|---|
f2c6fce7c9 | |||
c5783268f8 |
16
entry.go
16
entry.go
@ -6,6 +6,10 @@ 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"`
|
||||
@ -15,10 +19,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"`
|
||||
}
|
||||
@ -93,7 +97,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)
|
||||
}
|
||||
}
|
||||
@ -105,7 +109,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)
|
||||
}
|
||||
}
|
||||
@ -113,7 +117,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)
|
||||
}
|
||||
}
|
||||
|
6
feed.go
6
feed.go
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user