test(trace): document ViolationsAreGreppable grep contract and lock-free WriteScreenshot

This commit is contained in:
pj committed 2026-06-06 13:04:15 +05:30
1 parent e3e810d8db
commit 925b0617ef
2 files changed
+9

No files matched your search

+3
View File
@@ -158,6 +158,9 @@ func (w *Writer) WriteStep(step Step) error {
return w.encoder.Encode(step)
}
// WriteScreenshot is lock-free: each call writes a distinct, uniquely-named
// file via os.WriteFile and touches no field of Writer, so concurrent calls
// never contend.
func (w *Writer) WriteScreenshot(stepIndex int, png []byte) error {
return w.writePNG(fmt.Sprintf("step-%05d.png", stepIndex), png)
}