code: func (ms *FileMsgStore) Empty() error {
  	ms.Lock()
  	defer ms.Unlock()
  
  	var err error
  	// Remove/close all file slices
  	for sliceID, slice := range ms.files {
  		ms.fm.remove(slice.file)
  		ms.fm.remove(slice.idxFile)
  		if slice.file.handle != nil {
  			err = util.CloseFile(err, slice.file.handle)
  		}
  		if lerr := os.Remove(slice.file.name); lerr != nil && err == nil {
  			err = lerr
  		}
  		if slice.idxFile.handle != nil {
  			err = util.CloseFile(err, slice.idxFile.handle)
  		}
  		if lerr := os.Remove(slice.idxFile.name); lerr != nil && err == nil {
  			err = lerr
  		}
  		delete(ms.files, sliceID)
  	}
  	// Reset generic counters
  	ms.empty()
  	// FileMsgStore specific
  	ms.writer = nil
  	ms.writeSlice = nil
  	ms.cache.empty()
  	ms.wOffset = 0
  	ms.firstMsg, ms.lastMsg = nil, nil
  	ms.expiration = 0
  	ms.firstFSlSeq, ms.lastFSlSeq = 0, 0
  	// If we are running in buffered mode...
  	if ms.bw != nil {
  		ms.bw = newBufferWriter(msgBufMinShrinkSize, ms.fstore.opts.BufferSize)
  		ms.bufferedSeqs = make([]uint64, 0, 1)
  		ms.bufferedMsgs = make(map[uint64]*bufferedMsg)
  	}
  	return err
  }
docs: // Empty implements the MsgStore interface