Compare commits
No commits in common. "656ae8ad46c68cbc4900660a0a97d9d337a6af93" and "f6bbc2fa6f72dc57c4b73239925b040a4b2a602e" have entirely different histories.
656ae8ad46
...
f6bbc2fa6f
7
entry.go
7
entry.go
@ -27,10 +27,6 @@ type Entry struct {
|
|||||||
Extensions []*ExtensionElement `xml:",any,omitempty"`
|
Extensions []*ExtensionElement `xml:",any,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// atom:entry elements MUST contain one or more atom:author elements, unless
|
|
||||||
// the atom:entry contains an atom:source element that contains an atom:author
|
|
||||||
// element or, in an Atom Feed Document, the atom:feed element contains an
|
|
||||||
// atom:author element itself.
|
|
||||||
func (e *Entry) checkAuthors() error {
|
func (e *Entry) checkAuthors() error {
|
||||||
if e.Authors == nil {
|
if e.Authors == nil {
|
||||||
if e.Source.Authors == nil {
|
if e.Source.Authors == nil {
|
||||||
@ -85,9 +81,6 @@ func (e *Entry) Check() error {
|
|||||||
return fmt.Errorf("content element of entry %v: %v", e.ID.URI, err)
|
return fmt.Errorf("content element of entry %v: %v", e.ID.URI, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// atom:entry elements that contain no child atom:content element MUST
|
|
||||||
// contain at least one atom:link element with a rel attribute value of
|
|
||||||
// "alternate".
|
|
||||||
if !alternateRelExists(e.Links) {
|
if !alternateRelExists(e.Links) {
|
||||||
return errors.New("no content element of entry %v and no link element with rel \"alternate\"")
|
return errors.New("no content element of entry %v and no link element with rel \"alternate\"")
|
||||||
}
|
}
|
||||||
|
3
feed.go
3
feed.go
@ -142,9 +142,6 @@ func (f *Feed) Check() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// atom:feed elements MUST contain one or more atom:author elements, unless
|
|
||||||
// all of the atom:feed element's child atom:entry elements contain at
|
|
||||||
// least one atom:author element.
|
|
||||||
if f.Authors == nil {
|
if f.Authors == nil {
|
||||||
for _, e := range f.Entries {
|
for _, e := range f.Entries {
|
||||||
if err := e.checkAuthors(); err != nil {
|
if err := e.checkAuthors(); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user