Что думаешь? Оцени!
If fn() takes longer than the timeout then the parent returns nil and nobody ever reads from ch. The child goroutine blocks on ch <- result and will never be cleaned up. Go garbage-collects objects, but it doesn’t garbage-collect goroutines blocked on channels that will never be read.
,这一点在搜狗输入法下载中也有详细论述
Фото: Alina Smutko / Reuters
https://feedx.net