code: func (s *VolumesService) Remove(ctx context.Context, name string, rmOpts ...opts.RemoveOption) error {
  	var cfg opts.RemoveConfig
  	for _, o := range rmOpts {
  		o(&cfg)
  	}
  
  	v, err := s.vs.Get(ctx, name)
  	if err != nil {
  		if IsNotExist(err) && cfg.PurgeOnError {
  			return nil
  		}
  		return err
  	}
  
  	err = s.vs.Remove(ctx, v, rmOpts...)
  	if IsNotExist(err) {
  		err = nil
  	} else if IsInUse(err) {
  		err = errdefs.Conflict(err)
  	} else if IsNotExist(err) && cfg.PurgeOnError {
  		err = nil
  	}
  
  	if err == nil {
  		s.eventLogger.LogVolumeEvent(v.Name(), "destroy", map[string]string{"driver": v.DriverName()})
  	}
  	return err
  }
docs: // Remove removes a volume
  // An error is returned if the volume is still referenced.