Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #317, Prevents premature closure of the channel in case of a time…
…out that leads to a panic 1. Adjusting the timing of channel closures 2. Ensure that the channel is of sufficient size
- Loading branch information
de646f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To set an explicit capacity of channel could't solve the issue, because when executing the code [ c <- err ], the channel possibly had been closed, and it would cause a panic.
For me, now I just add a recover() in the waiting goroutine.