code: func (w *Writer) writePending() {
  	if w.err != nil {
  		return
  	}
  	if w.pending {
  		w.fillHeader(true)
  		w.pending = false
  	}
  	_, w.err = w.w.Write(w.buf[w.written:w.j])
  	w.written = w.j
  }
docs: // writePending finishes the current journal and writes the buffer to the
  // underlying writer.