Skip to content

Commit

Permalink
refactor: Using shadowing for launching goroutine in a loop
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed May 4, 2022
1 parent 9c1564a commit 6da6fce
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/notifier/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ func (a App) getNewStandardReleases(ctx context.Context) ([]model.Release, uint6
}

for _, repo := range repositories {
repo := repo
count++

func(repo model.Repository) {
wg.Go(func() {
workerOutput <- a.getNewRepositoryReleases(ctx, repo)
})
}(repo)
wg.Go(func() {
workerOutput <- a.getNewRepositoryReleases(ctx, repo)
})
}

if repoCount < int(pageSize) {
Expand Down

0 comments on commit 6da6fce

Please sign in to comment.