SlyMarbo / rss

A Go library for fetching, parsing, and updating RSS feeds.
Other
400 stars 85 forks source link

Is a RSS channel with no feeds faulty? #64

Closed ghost closed 6 years ago

ghost commented 6 years ago

Consider a RSS feed with no feeds:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Willkommen auf unserem Blog</title>
    <link>https://www.bitkom.org//bitkom/org/Presse/Blog/index.jsp</link>
    <description>Der RSS Feed mit den aktuellsten Blogbeiträgen</description>
    <language>de</language>
  </channel>
</rss>

For such a feed parseRSS2 returns an error:

https://github.com/SlyMarbo/rss/blob/6288663a2d2f9d8c80085f6d2ae9b80cf35e355a/rss_2.0.go#L65

But such a feed is valid.

Wouldn't it more consistent to not return an error but a Feed with no items?

SlyMarbo commented 6 years ago

Very sensible suggestion, which I've implemented. Thanks!

ghost commented 6 years ago

Great, thank you!