Add hasAlternateDuplicateLinks check to entry
This commit is contained in:
parent
6782d0c847
commit
9920e077eb
3
entry.go
3
entry.go
@ -104,6 +104,9 @@ func (e *Entry) Check() error {
|
||||
return fmt.Errorf("link element %v of entry %v: %v", i, e.ID.URI, err)
|
||||
}
|
||||
}
|
||||
if hasAlternateDuplicateLinks(e.Links) {
|
||||
return fmt.Errorf("links with with a rel attribute value of \"alternate\" and duplicate type and hreflang attribute values found in entry %v", e.ID.URI)
|
||||
}
|
||||
|
||||
if e.Published != nil {
|
||||
if err := e.Published.Check(); err != nil {
|
||||
|
2
feed.go
2
feed.go
@ -170,7 +170,7 @@ func (f *Feed) Check() error {
|
||||
}
|
||||
}
|
||||
if hasAlternateDuplicateLinks(f.Links) {
|
||||
return errors.New("links with with a rel attribute value of \"alternate\" and duplicate type and hreflang attribute values found")
|
||||
return fmt.Errorf("links with with a rel attribute value of \"alternate\" and duplicate type and hreflang attribute values found in feed %v", f.ID.URI)
|
||||
}
|
||||
|
||||
if f.Logo != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user