MustTFromContext returns the *testing.T from the context, and panics if it was not saved in the context.
(ctx context.Context)
| 56 | |
| 57 | // MustTFromContext returns the *testing.T from the context, and panics if it was not saved in the context. |
| 58 | func MustTFromContext(ctx context.Context) *testing.T { |
| 59 | t, ok := TFromContext(ctx) |
| 60 | if !ok { |
| 61 | panic("*testing.T not present in the context") |
| 62 | } |
| 63 | return t |
| 64 | } |
| 65 | |
| 66 | // ContextWithCounterRef adds the given counter to ctx under key specified. |
| 67 | func ContextWithCounterRef(ctx context.Context, key any, i *int64) context.Context { |