diff --git a/internal/publish/to_slack.go b/internal/publish/to_slack.go index 6f16a40..b8d6fa6 100644 --- a/internal/publish/to_slack.go +++ b/internal/publish/to_slack.go @@ -33,16 +33,7 @@ func PublishAsGeneralSlackMessage(channelNames []string, reports []scanner.Repor wg.Wait() close(errChan) - var outErr error - for err := range errChan { - if err != nil { - outErr = errors.Join(err, outErr) - } - } - if outErr != nil { - outErr = errors.Join(errors.New("errors occured when posting to slack channel"), outErr) - } - + outErr := errors.Join(<-errChan) return outErr }