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:
parent
abfd9306a4
commit
a412cde3b3
1 changed files with 6 additions and 6 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue