diff options
author | siddharth ravikumar <s@ricketyspace.net> | 2022-11-25 19:12:24 -0500 |
---|---|---|
committer | siddharth ravikumar <s@ricketyspace.net> | 2022-11-25 19:12:24 -0500 |
commit | c4b7b46835ae6118ffaa7aa0b234211b3fdc28cc (patch) | |
tree | 4d4e0b44476fa65019c2e1601b164bc1b411b4be /feed/feed.go | |
parent | 8a5edb8363314ab5ef7abad6ac06e3a18f437c05 (diff) |
feed: fix `go vet` warnings
Diffstat (limited to 'feed/feed.go')
-rw-r--r-- | feed/feed.go | 26 |
1 files changed, 22 insertions, 4 deletions
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 |