Skip to content

Commit

Permalink
Merge pull request #3 from galaxyhao/fix_readme
Browse files Browse the repository at this point in the history
FIX README.md
  • Loading branch information
umputun committed Apr 1, 2022
2 parents 5aca34c + 415032a commit c89a527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In order to block goroutines from even starting use `Preemptive` option (see bel
```go
swg := syncs.NewSizedGroup(5) // wait group with max size=5
for i :=0; i<10; i++ {
swg.Go(fn func(ctx context.Context){
swg.Go(func(ctx context.Context){
doThings(ctx) // only 5 of these will run in parallel
})
}
Expand All @@ -58,7 +58,7 @@ dropped under max. This way we not only limiting number of running goroutines bu
```go
ewg := syncs.NewErrSizedGroup(5, syncs.Preemptive) // error wait group with max size=5, don't try to start more if any error happened
for i :=0; i<10; i++ {
ewg.Go(fn func(ctx context.Context) error { // Go here could be blocked if trying to run >5 at the same time
ewg.Go(func(ctx context.Context) error { // Go here could be blocked if trying to run >5 at the same time
err := doThings(ctx) // only 5 of these will run in parallel
return err
})
Expand Down

0 comments on commit c89a527

Please sign in to comment.