From 38ddfbc4d3bb4291146b617e898fe9d7f485d2f6 Mon Sep 17 00:00:00 2001 From: Alexander Bruyako Date: Mon, 27 Jan 2020 18:41:46 +0300 Subject: [PATCH] simpler error return --- internal/repository/worker_group.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/repository/worker_group.go b/internal/repository/worker_group.go index 6b9dc6ddf..20783b188 100644 --- a/internal/repository/worker_group.go +++ b/internal/repository/worker_group.go @@ -24,10 +24,6 @@ func RunWorkers(ctx context.Context, count int, workerFunc func() error, finalFu // make sure finalFunc is run finalFunc() - // if the workers returned an error, return it to the caller - if err != nil { - return err - } - - return nil + // return error from workers to the caller + return err }