Skip to content

Commit a3ce86a

Browse files
committed
Add comment to make code more readable.
1 parent 53c0e47 commit a3ce86a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diskqueue.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ func (d *diskQueue) writeOne(data []byte) error {
421421
return fmt.Errorf("invalid message write size (%d) minMsgSize=%d maxMsgSize=%d", dataLen, d.minMsgSize, d.maxMsgSize)
422422
}
423423

424+
// add all data to writeBuf before writing to file
425+
// this causes everything to be written to file or nothing
424426
d.writeBuf.Reset()
425427
err = binary.Write(&d.writeBuf, binary.BigEndian, dataLen)
426428
if err != nil {

0 commit comments

Comments
 (0)