From 7de921b1b55e818a5f34db3bca5c023ad7b1bbf9 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 16:20:11 +0200 Subject: [PATCH] Cleanup --- entry.go | 8 ++++---- feed.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/entry.go b/entry.go index 3158adc..0cb2690 100644 --- a/entry.go +++ b/entry.go @@ -39,6 +39,10 @@ func (e *Entry) checkAuthors() error { return nil } +func (e *Entry) AddExtension(name string, value any) { + e.Extensions = append(e.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}) +} + func (e *Entry) Check() error { if e.ID == nil { return errors.New("no id element of entry") @@ -132,7 +136,3 @@ func (e *Entry) Check() error { return nil } - -func (e *Entry) AddExtension(name string, value any) { - e.Extensions = append(e.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}) -} diff --git a/feed.go b/feed.go index c492c2c..3a3379e 100644 --- a/feed.go +++ b/feed.go @@ -25,6 +25,10 @@ type Feed struct { Entries []*Entry `xml:"entry,omitempty"` } +func (f *Feed) AddExtension(name string, value any) { + f.Extensions = append(f.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}) +} + func (f *Feed) Check() error { if f.ID == nil { return errors.New("no id element of feed") @@ -156,10 +160,6 @@ func (f *Feed) Standardize() { } } -func (f *Feed) AddExtension(name string, value any) { - f.Extensions = append(f.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}) -} - func (f *Feed) ToXML(encoding string) (string, error) { xml, err := xml.MarshalIndent(f, "", " ") if err != nil {