Skip to content

Commit

Permalink
fix example in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cfchou committed Oct 24, 2017
1 parent edea752 commit e7d63dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ func main() {
ticketPool := make(chan struct{}, 1000)
for {
ticketPool <- struct{}{}
go stream.Get(context.Background())
<-ticketPool
go func() {
defer func(){ <-ticketPool }()
stream.Get(context.Background())
}()
}
}
```
Expand Down
6 changes: 4 additions & 2 deletions gentle/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ Example cont.(error handling is omitted for brevity):
ticketPool := make(chan struct{}, 1000)
for {
ticketPool <- struct{}{}
go stream.Get(context.Background())
<-ticketPool
go func() {
defer func(){ <-ticketPool }()
stream.Get(context.Background())
}()
}
}
Expand Down

0 comments on commit e7d63dd

Please sign in to comment.