From 10a8d27462390c6663797124cc94503e18dd09d6 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 6 May 2020 22:50:00 -0700 Subject: [PATCH] Fix issues found by errcheck Signed-off-by: Chris Cummer --- modules/gitlabtodo/widget.go | 6 ++++-- modules/ipaddresses/ipinfo/widget.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/gitlabtodo/widget.go b/modules/gitlabtodo/widget.go index e6f1c16e..54102c98 100644 --- a/modules/gitlabtodo/widget.go +++ b/modules/gitlabtodo/widget.go @@ -125,8 +125,10 @@ func (widget *Widget) markAsDone() { sel := widget.GetSelected() if sel >= 0 && widget.todos != nil && sel < len(widget.todos) { todo := widget.todos[sel] - widget.gitlabClient.Todos.MarkTodoAsDone(todo.ID) - widget.Refresh() + _, err := widget.gitlabClient.Todos.MarkTodoAsDone(todo.ID) + if err == nil { + widget.Refresh() + } } } diff --git a/modules/ipaddresses/ipinfo/widget.go b/modules/ipaddresses/ipinfo/widget.go index c162e50b..ce6fdf01 100644 --- a/modules/ipaddresses/ipinfo/widget.go +++ b/modules/ipaddresses/ipinfo/widget.go @@ -128,7 +128,7 @@ func getMyIP() (ip net.IP, v6 bool) { if err != nil { return } - defer conn.Close() + defer func() { _ = conn.Close() }() addr := conn.LocalAddr().(*net.TCPAddr) ip = addr.IP