Context - Golang - Complete Documentation by ntxm.org

Context Basics in Go

What context.Context is, how contexts form a tree from Background, and how to stop work early with WithCancel.

Deadlines and Timeouts with Go Context

Limit how long work can run with WithTimeout and WithDeadline, and find out why a context ended.

Context Values in Go

Carry request IDs and user information through a request with context.WithValue, and know what should stay a normal parameter.

Context in Real Go Programs

Use context in HTTP handlers and clients, with database/sql, and avoid the most common context mistakes.