From dd45f63209a8e51979b11182253ee80b5289c10a Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 25 Oct 2018 19:25:10 +0200 Subject: Drop Version, make lint happy --- rss.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rss.go') diff --git a/rss.go b/rss.go index a445054..d14db94 100644 --- a/rss.go +++ b/rss.go @@ -9,18 +9,18 @@ import ( "dim13.org/rss" ) -type Feed struct { +type feed struct { Name string URL string Every time.Duration } -type News struct { - Feed +type news struct { + feed rss.Item } -func (n News) String() string { +func (n news) String() string { s := fmt.Sprintf("%v: %v", n.Name, n.Title) if n.Author != "" { s += fmt.Sprintf(" (%v) ", n.Author) @@ -31,7 +31,7 @@ func (n News) String() string { return s } -func (f Feed) watch(w io.Writer) { +func (f feed) watch(w io.Writer) { ticker := time.NewTicker(f.Every) defer ticker.Stop() for t := range ticker.C { @@ -43,13 +43,13 @@ func (f Feed) watch(w io.Writer) { last := t.Add(-f.Every) for _, i := range r.Channel.Items { if i.PubDate.After(last) { - fmt.Fprint(w, News{f, i}) + fmt.Fprint(w, news{f, i}) } } } } -func Watch(w io.Writer, feeds []Feed) { +func watch(w io.Writer, feeds []feed) { for _, feed := range feeds { go feed.watch(w) } -- cgit v1.2.3