code: func (w *Writer) finalizeTail() error {
  	tf := w.tail()
  	if tf == nil {
  		return nil
  	}
  
  	if err := w.wbuf.Flush(); err != nil {
  		return err
  	}
  	if err := tf.Sync(); err != nil {
  		return err
  	}
  	// As the file was pre-allocated, we truncate any superfluous zero bytes.
  	off, err := tf.Seek(0, io.SeekCurrent)
  	if err != nil {
  		return err
  	}
  	if err := tf.Truncate(off); err != nil {
  		return err
  	}
  
  	return tf.Close()
  }
docs: // finalizeTail writes all pending data to the current tail file,
  // truncates its size, and closes it.