godis源码阅读July 11, 2024 · 33 min readayanamitcp echo 一个优雅超时关闭的方法 // WaitWithTimeout blocks until the WaitGroup counter is zero or timeout// returns true if timeoutfunc (w *Wait) WaitWithTimeout(timeout time.Duration) bool { c := make(chan struct{}, 1) go func() { defer close(c)