← Go Lesson 7

Lesson 7: Context: Cancellation, Deadlines & Values

7 min read

1. Q1: Why must you always call cancel() from WithCancel/WithTimeout?

2. Q2: Why use typed keys for WithValue instead of plain strings?

3. Q3: What does ctx.Err() return when the context is NOT cancelled?