aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/opml/serializer.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-20 19:11:06 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-20 19:11:06 -0800
commitc26787f47667f69a2d3e85db01fe20b9bc70bc9a (patch)
tree5a8d8faa039569cdae677a63acbe7ff0db299fb5 /reader/opml/serializer.go
parente91a9b4f13b50bd7ac112510d80fbe61e039a9e9 (diff)
Improve OPML package to be more idiomatic
Diffstat (limited to 'reader/opml/serializer.go')
-rw-r--r--reader/opml/serializer.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/reader/opml/serializer.go b/reader/opml/serializer.go
index 3ca859a..5ba494e 100644
--- a/reader/opml/serializer.go
+++ b/reader/opml/serializer.go
@@ -17,13 +17,13 @@ func Serialize(subscriptions SubcriptionList) string {
writer := bufio.NewWriter(&b)
writer.WriteString(xml.Header)
- opml := new(Opml)
- opml.Version = "2.0"
+ feeds := new(opml)
+ feeds.Version = "2.0"
for categoryName, subs := range groupSubscriptionsByFeed(subscriptions) {
- outline := Outline{Text: categoryName}
+ category := outline{Text: categoryName}
for _, subscription := range subs {
- outline.Outlines = append(outline.Outlines, Outline{
+ category.Outlines = append(category.Outlines, outline{
Title: subscription.Title,
Text: subscription.Title,
FeedURL: subscription.FeedURL,
@@ -31,12 +31,12 @@ func Serialize(subscriptions SubcriptionList) string {
})
}
- opml.Outlines = append(opml.Outlines, outline)
+ feeds.Outlines = append(feeds.Outlines, category)
}
encoder := xml.NewEncoder(writer)
encoder.Indent(" ", " ")
- if err := encoder.Encode(opml); err != nil {
+ if err := encoder.Encode(feeds); err != nil {
log.Println(err)
return ""
}