ContextError checks to see if ctx is in error. If it is in error then it overwrites *perr with the context error if *perr was nil and returns true. Otherwise it returns false.
(ctx context.Context, perr *error)
| 450 | // |
| 451 | // Otherwise it returns false. |
| 452 | func ContextError(ctx context.Context, perr *error) bool { |
| 453 | if ctxErr := ctx.Err(); ctxErr != nil { |
| 454 | if *perr == nil { |
| 455 | *perr = ctxErr |
| 456 | } |
| 457 | return true |
| 458 | } |
| 459 | return false |
| 460 | } |
searching dependent graphs…