PanicTB is an implementation for testing.TB that panics when an error is logged or FailNow is called. This is useful to inject into test helpers in example tests where no *testing.T is available. If env is set with `RIVER_DEBUG=true`, output is logged to os.Stderr (Stderr instead of Stdout to not i
()
| 20 | // Doesn't fully implement testing.TB. Functions where it's used should take the |
| 21 | // more streamlined TestingTB instead. |
| 22 | func PanicTB() *panicTB { |
| 23 | return &panicTB{} |
| 24 | } |
| 25 | |
| 26 | func (tb *panicTB) Errorf(format string, args ...any) { |
| 27 | panic(fmt.Sprintf(format, args...)) |
no outgoing calls
searching dependent graphs…