Standard library / context
context.DeadlineExceeded
Sentinel error returned when a context deadline expires. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var DeadlineExceeded errorWorking Example
Example Snippetgo
package main
import ( "context" "errors" "fmt")
func main() { ctx, cancel := context.WithTimeout(context.Background(), 0) defer cancel() fmt.Println(errors.Is(ctx.Err(), context.DeadlineExceeded))}