diff --git a/category.go b/category.go index 1db4228..16ef541 100644 --- a/category.go +++ b/category.go @@ -16,7 +16,7 @@ type Category struct { // NewCategory creates a new Category. It returns a *Category. func NewCategory(term string) *Category { return &Category{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Term: term, } } diff --git a/commonAttributes.go b/commonAttributes.go index 8c8dc6d..bbc5574 100644 --- a/commonAttributes.go +++ b/commonAttributes.go @@ -13,7 +13,7 @@ type CommonAttributes struct { // NewCommonAttributes creates a new set of CommonAttributes. It returns a // *CommonAttributes. -func newCommonAttributes() *CommonAttributes { +func NewCommonAttributes() *CommonAttributes { return new(CommonAttributes) } diff --git a/date.go b/date.go index 809ad0b..35b14ff 100644 --- a/date.go +++ b/date.go @@ -19,7 +19,7 @@ func DateTime(t time.Time) string { // NewDate creates a new Date. It returns a *Date. func NewDate(t time.Time) *Date { return &Date{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), DateTime: DateTime(t), } } diff --git a/entry.go b/entry.go index b7d4cfa..7479458 100644 --- a/entry.go +++ b/entry.go @@ -59,7 +59,7 @@ func (e *Entry) checkAuthors(authorInFeed bool) error { // NewEntry creates a new Entry. It returns a *Entry. func NewEntry(title string) *Entry { return &Entry{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), ID: NewID(NewURN()), Title: NewText("text", title), Updated: NewDate(time.Now()), diff --git a/feed.go b/feed.go index 4d9b395..dc8d07a 100644 --- a/feed.go +++ b/feed.go @@ -28,7 +28,7 @@ type Feed struct { // NewFeed creates a new Feed. It returns a *Feed. func NewFeed(title string) *Feed { return &Feed{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), ID: NewID(NewURN()), Title: NewText("text", title), Updated: NewDate(time.Now()), diff --git a/generator.go b/generator.go index ed859b8..5087958 100644 --- a/generator.go +++ b/generator.go @@ -17,7 +17,7 @@ type Generator struct { // NewGenerator creates a new Generator. It returns a *Generator. func NewGenerator(text string) *Generator { return &Generator{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Text: html.UnescapeString(text), } } diff --git a/icon.go b/icon.go index c33cb33..ebf7d89 100644 --- a/icon.go +++ b/icon.go @@ -15,7 +15,7 @@ type Icon struct { // NewIcon creates a new Icon. It returns a *Icon. func NewIcon(uri string) *Icon { return &Icon{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), URI: uri, } } diff --git a/id.go b/id.go index 71d6561..3c9b3e3 100644 --- a/id.go +++ b/id.go @@ -15,7 +15,7 @@ type ID struct { // NewID creates a new ID. It returns a *ID. func NewID(uri string) *ID { return &ID{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), URI: uri, } } diff --git a/inlineOtherContent.go b/inlineOtherContent.go index 112d2fb..622efa8 100644 --- a/inlineOtherContent.go +++ b/inlineOtherContent.go @@ -19,7 +19,7 @@ func newInlineOtherContent(mediaType string, content any) *InlineOtherContent { mediaType, _, _ = mime.ParseMediaType(mediaType) return &InlineOtherContent{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: mediaType, AnyElement: content, } diff --git a/inlineTextContent.go b/inlineTextContent.go index 0c256f3..b094cf9 100644 --- a/inlineTextContent.go +++ b/inlineTextContent.go @@ -16,7 +16,7 @@ type InlineTextContent struct { // *InlineTextContent. func newInlineTextContent(mediaType, text string) *InlineTextContent { return &InlineTextContent{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: mediaType, Text: text, } diff --git a/inlineXHTMLContent.go b/inlineXHTMLContent.go index 872bed8..c115627 100644 --- a/inlineXHTMLContent.go +++ b/inlineXHTMLContent.go @@ -16,7 +16,7 @@ type InlineXHTMLContent struct { // *InlineXHTMLContent. func newInlineXHTMLContent(mediaType string, div *XHTMLDiv) *InlineXHTMLContent { return &InlineXHTMLContent{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: mediaType, XHTMLDiv: div, } diff --git a/link.go b/link.go index 0deb005..d90d067 100644 --- a/link.go +++ b/link.go @@ -20,7 +20,7 @@ type Link struct { // NewLink creates a new Link. It returns a *Link. func NewLink(href string) *Link { return &Link{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Href: href, } } diff --git a/logo.go b/logo.go index a35843f..d63ec05 100644 --- a/logo.go +++ b/logo.go @@ -14,7 +14,7 @@ type Logo struct { // NewLogo creates a new Logo. It returns a *Logo. func NewLogo(uri string) *Logo { return &Logo{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), URI: uri, } } diff --git a/outOfLineContent.go b/outOfLineContent.go index 47ea848..249819b 100644 --- a/outOfLineContent.go +++ b/outOfLineContent.go @@ -19,7 +19,7 @@ func newOutOfLineContent(mediaType, src string) *OutOfLineContent { mediaType, _, _ = mime.ParseMediaType(mediaType) return &OutOfLineContent{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: mediaType, SRC: src, } diff --git a/person.go b/person.go index 665ac31..72c15b8 100644 --- a/person.go +++ b/person.go @@ -16,7 +16,7 @@ type Person struct { // NewPerson creates a new Person. It returns a *Person. func NewPerson(name string) *Person { return &Person{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Name: name, } } diff --git a/plainText.go b/plainText.go index 651f22a..a6ef330 100644 --- a/plainText.go +++ b/plainText.go @@ -16,7 +16,7 @@ func (p *PlainText) isText() bool { return true } // newPlainText creates a new PlainText. It returns a *PlainText. func newPlainText(textType, content string) *PlainText { return &PlainText{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: textType, Text: content, } diff --git a/source.go b/source.go index 33e791a..ed1093f 100644 --- a/source.go +++ b/source.go @@ -25,7 +25,7 @@ type Source struct { // NewSource creates a new Source. It returns a *Source. func NewSource() *Source { - return &Source{CommonAttributes: newCommonAttributes()} + return &Source{CommonAttributes: NewCommonAttributes()} } // AddAuthor adds the Person as an author to the Source. It returns its index as diff --git a/xhtmlText.go b/xhtmlText.go index 26ffac8..e92dc88 100644 --- a/xhtmlText.go +++ b/xhtmlText.go @@ -16,7 +16,7 @@ func (x *XHTMLText) isText() bool { return true } // newPlainText creates a new PlainText. It returns a *PlainText. func newXHTMLText(textType, content string) *XHTMLText { return &XHTMLText{ - CommonAttributes: newCommonAttributes(), + CommonAttributes: NewCommonAttributes(), Type: textType, XHTMLDiv: NewXHTMLDiv(content), }