tinycodinglm / lang /lang-0017.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 15)
b27bfb3 verified
|
Raw History Blame Contribute Delete
721 Bytes
opencode trace
System You are an expert software engineer.

You are an expert software engineer.

User

How does Go's context package work?

Assistant

Carries cancellation, deadlines, request-scoped values.

Background()/TODO() roots. WithCancel/WithTimeout/WithDeadline create derived contexts. WithValue for request-scoped data.

Cancellation propagates to all children. Done() channel, Err() returns Canceled/DeadlineExceeded.

Pattern: pass as first param, don't store in structs, don't pass nil.