code: func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
  	p, err := pm.config.Store.GetV2Plugin(name)
  	pm.mu.RLock()
  	c := pm.cMap[p]
  	pm.mu.RUnlock()
  
  	if err != nil {
  		return err
  	}
  
  	if !config.ForceRemove {
  		if p.GetRefCount() > 0 {
  			return inUseError(p.Name())
  		}
  		if p.IsEnabled() {
  			return enabledError(p.Name())
  		}
  	}
  
  	if p.IsEnabled() {
  		if err := pm.disable(p, c); err != nil {
  			logrus.Errorf("failed to disable plugin '%s': %s", p.Name(), err)
  		}
  	}
  
  	defer func() {
  		go pm.GC()
  	}()
  
  	id := p.GetID()
  	pluginDir := filepath.Join(pm.config.Root, id)
  
  	if err := mount.RecursiveUnmount(pluginDir); err != nil {
  		return errors.Wrap(err, "error unmounting plugin data")
  	}
  
  	if err := atomicRemoveAll(pluginDir); err != nil {
  		return err
  	}
  
  	pm.config.Store.Remove(p)
  	pm.config.LogPluginEvent(id, name, "remove")
  	pm.publisher.Publish(EventRemove{Plugin: p.PluginObj})
  	return nil
  }
docs: // Remove deletes plugin's root directory.