From bd7bb5f9f00c88b9cfa36d58c9821854ea2db894 Mon Sep 17 00:00:00 2001 From: makeworld Date: Fri, 18 Dec 2020 16:30:06 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Use=20err=20from=20AddPage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subscriptions/subscriptions.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subscriptions/subscriptions.go b/subscriptions/subscriptions.go index a879d95..afea91c 100644 --- a/subscriptions/subscriptions.go +++ b/subscriptions/subscriptions.go @@ -341,10 +341,10 @@ func updateFeed(url string) { return } - AddFeed(newURL, feed) - if url != newURL { + err = AddFeed(newURL, feed) + if url != newURL && err == nil { // URL has changed, remove old one - Remove(url) + Remove(url) //nolint:errcheck } } @@ -354,10 +354,10 @@ func updatePage(url string) { return } - AddPage(newURL, res.Body) - if url != newURL { + err = AddPage(newURL, res.Body) + if url != newURL && err == nil { // URL has changed, remove old one - Remove(url) + Remove(url) //nolint:errcheck } }