From a412cde3b3c98a8d7ef20aabc6945f79aa4a5bfb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 20 Jan 2025 16:16:42 +0100 Subject: [PATCH] Don't define receivers on both values and pointer And use `o` instead of `outline` as done everywhere else. --- internal/reader/opml/opml.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/reader/opml/opml.go b/internal/reader/opml/opml.go index c6caa9c9..0f5c0f96 100644 --- a/internal/reader/opml/opml.go +++ b/internal/reader/opml/opml.go @@ -35,11 +35,11 @@ type opmlOutline struct { Outlines opmlOutlineCollection `xml:"outline,omitempty"` } -func (outline opmlOutline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { +func (o opmlOutline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { type opmlOutlineXml opmlOutline outlineType := "" - if outline.IsSubscription() { + if o.IsSubscription() { outlineType = "rss" } @@ -47,16 +47,16 @@ func (outline opmlOutline) MarshalXML(e *xml.Encoder, start xml.StartElement) er opmlOutlineXml Type string `xml:"type,attr,omitempty"` }{ - opmlOutlineXml: opmlOutlineXml(outline), + opmlOutlineXml: opmlOutlineXml(o), Type: outlineType, }, start) } -func (o *opmlOutline) IsSubscription() bool { +func (o opmlOutline) IsSubscription() bool { return strings.TrimSpace(o.FeedURL) != "" } -func (o *opmlOutline) GetTitle() string { +func (o opmlOutline) GetTitle() string { if o.Title != "" { return o.Title } @@ -76,7 +76,7 @@ func (o *opmlOutline) GetTitle() string { return "" } -func (o *opmlOutline) GetSiteURL() string { +func (o opmlOutline) GetSiteURL() string { if o.SiteURL != "" { return o.SiteURL }