1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Don't define receivers on both values and pointer

And use `o` instead of `outline` as done everywhere else.
This commit is contained in:
jvoisin 2025-01-20 16:16:42 +01:00 committed by Frédéric Guillot
parent abfd9306a4
commit a412cde3b3

View file

@ -35,11 +35,11 @@ type opmlOutline struct {
Outlines opmlOutlineCollection `xml:"outline,omitempty"` 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 type opmlOutlineXml opmlOutline
outlineType := "" outlineType := ""
if outline.IsSubscription() { if o.IsSubscription() {
outlineType = "rss" outlineType = "rss"
} }
@ -47,16 +47,16 @@ func (outline opmlOutline) MarshalXML(e *xml.Encoder, start xml.StartElement) er
opmlOutlineXml opmlOutlineXml
Type string `xml:"type,attr,omitempty"` Type string `xml:"type,attr,omitempty"`
}{ }{
opmlOutlineXml: opmlOutlineXml(outline), opmlOutlineXml: opmlOutlineXml(o),
Type: outlineType, Type: outlineType,
}, start) }, start)
} }
func (o *opmlOutline) IsSubscription() bool { func (o opmlOutline) IsSubscription() bool {
return strings.TrimSpace(o.FeedURL) != "" return strings.TrimSpace(o.FeedURL) != ""
} }
func (o *opmlOutline) GetTitle() string { func (o opmlOutline) GetTitle() string {
if o.Title != "" { if o.Title != "" {
return o.Title return o.Title
} }
@ -76,7 +76,7 @@ func (o *opmlOutline) GetTitle() string {
return "" return ""
} }
func (o *opmlOutline) GetSiteURL() string { func (o opmlOutline) GetSiteURL() string {
if o.SiteURL != "" { if o.SiteURL != "" {
return o.SiteURL return o.SiteURL
} }