v1.9.21 — fix data race in watchdog tests
Fix
The v1.9.19 CI added go test -race and v1.9.20 fixed the resulting IPv6 vet warning. v1.9.21 fixes the next thing race-mode flagged: watchdog_test.go shared a bytes.Buffer between the watchdog goroutine and the assertion code without synchronization. The race detector correctly identified this as unsafe concurrent access on the buffer.
Wrapped the buffer in a safeBuf type (mutex-protected Write/String/Len) so the watchdog goroutine writer and the test reader are properly synchronized.
The watchdog itself is unaffected — the race lived in the test harness, not the production code. The watchdog's own io.Writer write path is fine when given a thread-safe target (which scan-time os.Stderr is, and which safeBuf is, but a raw bytes.Buffer is not).
CI is now race-clean. go test -race ./... passes locally and on every push/PR via the workflow added in v1.9.19.
Install
curl -LO https://github.com/Nicholas-Kloster/aimap/releases/download/v1.9.21/aimap-linux-amd64
chmod +x aimap-linux-amd64
sudo mv aimap-linux-amd64 /usr/local/bin/aimap