> For the complete documentation index, see [llms.txt](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/10.0/10.3.md).

# 10.3 goroutine超时检查的两种方式

这节介绍两个非常重要的技巧来帮助您处理 goroutines 超时。简单说，这两个技巧帮您解决不得不一直等待一个 goroutine 完成它的工作，并且让您完全控制等待 goroutine 结束的时间。这两个技巧都使用方便的 `select` 关键字的功能并结合上节中使用过的 `time.After()` 函数。
