Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Fixing issue for Incorrect use of errors.Join in aws/client.go #608 (#…
Browse files Browse the repository at this point in the history
…609)

* Fixing issue for Incorrect use of errors.Join in aws/client.go #608

* Made changes after review in aws/client.go #608

* Made changes after review in aws/client.go #608

---------

Co-authored-by: praveen0raj <[email protected]>
  • Loading branch information
praveen0raj and praveen0raj authored Sep 12, 2023
1 parent 9d03999 commit 65aa95f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/orchestrator/provider/aws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,13 @@ func (c *Client) RunAssetScan(ctx context.Context, config *provider.ScanJobConfi
close(errs)

// NOTE: make sure to drain results channel
listOfErrors := make([]error, 0)
for e := range errs {
if e != nil {
// nolint:typecheck
err = errors.Join(err, e)
listOfErrors = append(listOfErrors, e)
}
}
err = errors.Join(listOfErrors...)
if err != nil {
return err
}
Expand Down Expand Up @@ -770,13 +771,13 @@ func (c *Client) RemoveAssetScan(ctx context.Context, config *provider.ScanJobCo
close(errs)

// NOTE: make sure to drain results channel
listOfErrors := make([]error, 0)
for e := range errs {
if e != nil {
// nolint:typecheck
err = errors.Join(err, e)
listOfErrors = append(listOfErrors, e)
}
}

err = errors.Join(listOfErrors...)
return err
}

Expand Down

0 comments on commit 65aa95f

Please sign in to comment.