code: func (f *sendReceiveFolder) deleteItemOnDisk(item protocol.FileInfo, scanChan chan<- string) (err error) {
  	defer func() {
  		err = errors.Wrap(err, contextRemovingOldItem)
  	}()
  
  	switch {
  	case item.IsDirectory():
  		// Directories aren't archived and need special treatment due
  		// to potential children.
  		return f.deleteDirOnDisk(item.Name, scanChan)
  
  	case !item.IsSymlink() && f.versioner != nil:
  		// If we should use versioning, let the versioner archive the
  		// file before we replace it. Archiving a non-existent file is not
  		// an error.
  		// Symlinks aren't archived.
  
  		return osutil.InWritableDir(f.versioner.Archive, f.fs, item.Name)
  	}
  
  	return osutil.InWritableDir(f.fs.Remove, f.fs, item.Name)
  }
docs: // deleteItemOnDisk deletes the file represented by old that is about to be replaced by new.