Browse Source

Don't define receivers on both values and pointer

And use `o` instead of `outline` as done everywhere else.
jvoisin 1 năm trước cách đây
mục cha
commit
a412cde3b3
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      internal/reader/opml/opml.go

+ 6 - 6
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
 	}