无缓冲channel导致的goroutine泄露

最近搞出来一个挺弱智的问题,记录一下,以示警戒。代码主要逻辑如下,使用 select和time.After()实现超时控制,doSomething()一定会返回结果。 ...

August 19, 2023 · 2 min · mengboy