Deadline
A deadline is the specified latest time by which a task, operation, delivery, or obligation is expected or required to be completed.
Learn Go with Pocket-Sized Projects
Deadline is a context.Context method that reports whether a deadline is set and returns its time when present.
- How it is used
- Controls the time allowed for remote or database calls and prevents downstream work from hanging indefinitely.
- How deep it goes
- Defines the method and contrasts it with Done, then applies per-call timeouts and tests expiration behavior.
- Examples
- Uses a 100-millisecond database timeout, a blocking mock, ctx.Done(), and context.DeadlineExceeded.
- What you can do after
- Apply it via context.WithTimeout, propagate the child context, and diagnose expiration through Done and Err.
Read how Learn Go with Pocket-Sized Projects explains deadline →
100 Go Mistakes and How to Avoid Them
A deadline is a time limit after which an operation or computation should be stopped or treated as expired.
- How it is used
- Uses deadlines to stop time-bounded I/O, message publication, and channel work in concurrent Go functions.
- How deep it goes
- Explains durations, absolute times, context propagation, cleanup, Done, Err, and interruptible channel operations.
- Examples
- Uses four-second radar-position publication and context-aware channel send and receive examples.
- What you can do after
- Apply it via Go contexts to bound operations, clean up derived contexts, and diagnose expiration with ctx.Err().
Read how 100 Go Mistakes and How to Avoid Them explains deadline →
gRPC Microservices in Go
A deadline is a configured time limit by which an operation must complete.
- How it is used
- Controls service-call duration, fails fast, and protects latency commitments across microservice boundaries.
- How deep it goes
- Explains Go context creation, cancellation, propagation, and gRPC timeout outcomes without descending into protocol internals.
- Examples
- Uses one-second Shipping calls, delayed Order and Product handlers, competing endpoints, and DEADLINE_EXCEEDED after a five-second limit.
- What you can do after
- Apply Go context.WithDeadline or context.WithTimeout to gRPC calls and handle cancellation or DEADLINE_EXCEEDED.
Related concepts
- timeoutalternative to · A timeout is a configured time limit after which an incomplete operation or wait is stopped, abandoned, or treated as unsuccessful.
- estimateconfigured by · An estimate is an approximate prediction or assessment of the time, effort, resources, or cost required for defined work or activity.
- contextused by · In Go, context.Context is an interface carrying cancellation signals, deadlines, and request-scoped values across function and service boundaries.
- delegationcontrasts with · Delegation is the assignment or transfer of work, responsibility, or authority to another person, system, or agent to act on behalf of the delegating party.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


