Go 1.27 reference · 3 entries

Go Errors, Context and Time

Wrap and inspect errors, cancel work with context, and handle durations and time formats.

NameDescriptionSince
errors.Is and errors.As Check whether an error chain contains a specific error value (Is) or an error of a specific type (As).
context.WithTimeout and WithCancel Derive a context that is cancelled after a timeout or on demand, to stop work and outbound calls that take too long.
time.Duration, Parse and Format Represent durations, measure elapsed time, and parse or format times with Go's reference layout (2006-01-02 15:04:05).

Was this page helpful?