X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/959c24478e2c3a596a81cca359fd784c897f46a2..448c931a776c3e3f65ca2eab11da0c062d597818:/tools_test.go?ds=inline diff --git a/tools_test.go b/tools_test.go index fbbea41..3075cbf 100644 --- a/tools_test.go +++ b/tools_test.go @@ -244,6 +244,13 @@ func newTestToolbox(t *testing.T, log ToolLog, dir string) *Toolbox { } } +func (r *ToolRecordingLog) Events() []string { + r.mutex.Lock() + defer r.mutex.Unlock() + + return append([]string(nil), r.events...) +} + func (r *ToolRecordingLog) Append(kind, text string) (Message, error) { r.mutex.Lock() defer r.mutex.Unlock() @@ -267,10 +274,3 @@ func (r *ToolRecordingLog) Flush(ctx context.Context) error { return ctx.Err() } - -func (r *ToolRecordingLog) Events() []string { - r.mutex.Lock() - defer r.mutex.Unlock() - - return append([]string(nil), r.events...) -}