Skip to content

Commit

Permalink
refactor: join err on channel directly
Browse files Browse the repository at this point in the history
  • Loading branch information
scastlara committed Dec 18, 2024
1 parent 67ebad6 commit 4af44c0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions internal/publish/to_slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 4af44c0

Please sign in to comment.