NewFakeSink returns a FakeSink ready for use.
(t testing.TB)
| 20 | |
| 21 | // NewFakeSink returns a FakeSink ready for use. |
| 22 | func NewFakeSink(t testing.TB) *FakeSink { |
| 23 | fs := &FakeSink{t: t} |
| 24 | t.Cleanup(func() { |
| 25 | fs.mu.Lock() |
| 26 | fs.tDone = true |
| 27 | fs.mu.Unlock() |
| 28 | }) |
| 29 | return fs |
| 30 | } |
| 31 | |
| 32 | // LogEntry implements slog.Sink. It appends the entry to the |
| 33 | // internal slice. |