Edit: After reading more of the book, this doesn’t seem to be an issue (see replies).
The “Append” function on the store splits writing the record size and the record itself into two separate writes. If the server were to crash between these writes the store file would be corrupted because, once the server starts up again the first Append will result in two sizes in a row.
Would it be better for this code to write the record size and the record all at once, in one call to either s.buf.Write or binary.Write?