From ea2554519fa434d7ef85a4cd297dde685323e1a5 Mon Sep 17 00:00:00 2001 From: milarin Date: Fri, 10 Mar 2023 22:58:13 +0100 Subject: [PATCH] removed implicit task adding --- view.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/view.go b/view.go index 2c4662e..f3de34e 100644 --- a/view.go +++ b/view.go @@ -53,8 +53,11 @@ func (v *View[K]) consumeReports(printReports bool) { }() for status := range v.reportCh { + if _, ok := v.taskMap[status.ID]; !ok { + panic(fmt.Sprintf("received report for unknown task (forgot to call View.Add()?): %v", v)) + } + v.lastReports[status.ID] = status - v.Add(status.ID) if printReports { v.print()