We look at how to write reproducible tests for file storage in Go: isolation via
t.TempDir(), designing APIs "for tests" (path as a parameter, returning
error), checking result invariants (file contents, absence of
.tmp-* junk, correctness of
.bak), test helpers with
t.Helper(), table-driven cases, and a basic lock-file scenario via
AcquireLock().