code: func (f *sendReceiveFolder) deleteDir(file protocol.FileInfo, dbUpdateChan chan<- dbUpdateJob, scanChan chan<- string) {
  	// Used in the defer closure below, updated by the function body. Take
  	// care not declare another err.
  	var err error
  
  	events.Default.Log(events.ItemStarted, map[string]string{
  		"folder": f.folderID,
  		"item":   file.Name,
  		"type":   "dir",
  		"action": "delete",
  	})
  
  	defer func() {
  		events.Default.Log(events.ItemFinished, map[string]interface{}{
  			"folder": f.folderID,
  			"item":   file.Name,
  			"error":  events.Error(err),
  			"type":   "dir",
  			"action": "delete",
  		})
  	}()
  
  	if err = f.deleteDirOnDisk(file.Name, scanChan); err != nil {
  		f.newPullError(file.Name, errors.Wrap(err, "delete dir"))
  		return
  	}
  
  	dbUpdateChan <- dbUpdateJob{file, dbUpdateDeleteDir}
  }
docs: // deleteDir attempts to remove a directory that was deleted on a remote