From c4b7b46835ae6118ffaa7aa0b234211b3fdc28cc Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Fri, 25 Nov 2022 19:12:24 -0500 Subject: feed: fix `go vet` warnings --- feed/feed.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'feed') diff --git a/feed/feed.go b/feed/feed.go index a3b125c..1223195 100644 --- a/feed/feed.go +++ b/feed/feed.go @@ -99,7 +99,11 @@ func (feed *Feed) get() ([]byte, error) { // Processes the feed. func (feed *Feed) Process(pState *state.ProcessState) { // Init FeedResult. - fr := state.FeedResult{feed.Id, "", nil} + fr := state.FeedResult{ + FeedId: feed.Id, + FeedResult: "", + Err: nil, + } // Get raw feed. bs, err := feed.get() @@ -188,7 +192,11 @@ func (feed *Feed) Process(pState *state.ProcessState) { func (feed *Feed) processEntry(entry schema.Entry, erc chan state.EntryResult) { // Init EntryResult. - er := state.EntryResult{entry.Id, entry.Title, nil} + er := state.EntryResult{ + EntryId: entry.Id, + EntryTitle: entry.Title, + Err: nil, + } // Download entry. fmt.Printf("[%s][%s] Going to download %s\n", feed.Id, @@ -253,7 +261,12 @@ func nprUnmarshal(bs []byte) ([]schema.Entry, error) { if err != nil { return nil, err } - entry := schema.Entry{e.Id, e.Title, t, e.Link.Url} + entry := schema.Entry{ + Id: e.Id, + Title: e.Title, + PubTime: t, + Link: e.Link.Url, + } entries = append(entries, entry) } return entries, nil @@ -274,7 +287,12 @@ func youtubeUnmarshal(bs []byte) ([]schema.Entry, error) { if err != nil { return nil, err } - entry := schema.Entry{e.Id, e.Title, t, e.Link.Url} + entry := schema.Entry{ + Id: e.Id, + Title: e.Title, + PubTime: t, + Link: e.Link.Url, + } entries = append(entries, entry) } return entries, nil -- cgit v1.2.3