From 3d561a2ebdf31ce794e21cacf6789b844fece86d Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Wed, 22 Feb 2017 19:24:18 +0100 Subject: Return early on error --- manager/manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manager') diff --git a/manager/manager.go b/manager/manager.go index 2a58aab..30c20a6 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -28,17 +28,17 @@ func (m *Manager) Run() { wg.Add(1) go func(w *work.Work) { + defer wg.Done() nw := m.Filter.Filter(w) err := nw.Error() if err != nil { fmt.Printf("Got an error when filtering Work: %q\n", err) + return } err = m.Output.Output(nw) if err != nil { fmt.Printf("Got an error when outputting Work: %q\n", err) } - - wg.Done() }(w) } -- cgit v1.2.3