invocationFromContext retrieves an invocation from a context. If no invocation is in the context, it returns nil.
(ctx context.Context)
| 1608 | // invocationFromContext retrieves an invocation from a context. |
| 1609 | // If no invocation is in the context, it returns nil. |
| 1610 | func invocationFromContext(ctx context.Context) *invocation { |
| 1611 | inv := ctx.Value(invocationCtxKey{}) |
| 1612 | if inv != nil { |
| 1613 | return inv.(*invocation) |
| 1614 | } |
| 1615 | return nil |
| 1616 | } |