HomeToolsAbout a20k

Context

What is it

Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.

func DoSomething(ctx context.Context, arg Arg) error { // ... use ctx ... }

Do not pass a nil Context, even if a function permits it. Pass context.TODO if you are unsure about which Context to use.

© VincentVanKoh