StepFromContext returns the debug step context stored in ctx.
(ctx context.Context)
| 60 | |
| 61 | // StepFromContext returns the debug step context stored in ctx. |
| 62 | func StepFromContext(ctx context.Context) (*StepContext, bool) { |
| 63 | sc, ok := ctx.Value(stepContextKey{}).(*StepContext) |
| 64 | if !ok { |
| 65 | return nil, false |
| 66 | } |
| 67 | return sc, true |
| 68 | } |
| 69 | |
| 70 | // ReuseStep marks ctx so wrapped model calls under it share one debug step. |
| 71 | func ReuseStep(ctx context.Context) context.Context { |