func writeReset(w func([]byte) error, b *bytes2.Buffer) error { err := w(b.Bytes()) b.Reset() return err }