code: func (s *blockStore) writeData(data []byte, fieldName string) error {
  	wc := s.writeCursor
  	n, err := wc.curFile.file.WriteAt(data, int64(wc.curOffset))
  	wc.curOffset += uint32(n)
  	if err != nil {
  		str := fmt.Sprintf("failed to write %s to file %d at "+
  			"offset %d: %v", fieldName, wc.curFileNum,
  			wc.curOffset-uint32(n), err)
  		return makeDbErr(database.ErrDriverSpecific, str, err)
  	}
  
  	return nil
  }
docs: // writeData is a helper function for writeBlock which writes the provided data
  // at the current write offset and updates the write cursor accordingly.  The
  // field name parameter is only used when there is an error to provide a nicer
  // error message.
  //
  // The write cursor will be advanced the number of bytes actually written in the
  // event of failure.
  //
  // NOTE: This function MUST be called with the write cursor current file lock
  // held and must only be called during a write transaction so it is effectively
  // locked for writes.  Also, the write cursor current file must NOT be nil.