> For the complete documentation index, see [llms.txt](https://denglj.gitbook.io/essential-go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context.md).

# 40 上下文(Context)

- [创建上下文](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/creating-a-context.md)
- [用上下文为HTTP请求设置超时](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/set-timeout-for-http-requests.md)
- [用上下文携带值](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/context-with-value.md)
- [编写可取消的函数](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/writing-cancellable-functions.md)
- [上下文就是带值的树](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/context-is-a-tree-of-values.md)
- [context.TODO() vs. context.Background()](https://denglj.gitbook.io/essential-go/common-standard-libraries/40-context/context-todo-vs-context-background.md)
