code: func (c *RemoteClient) cleanObjects() error {
  	// Get a slice of object names
  	objectNames, err := c.objectNames(c.container)
  	if err != nil {
  		return err
  	}
  
  	for _, object := range objectNames {
  		log.Printf("[DEBUG] Deleting object %s from container %s", object, c.container)
  		result := objects.Delete(c.client, c.container, object, nil)
  		if result.Err == nil {
  			continue
  		}
  
  		// if object is not found, it has already been deleted
  		if _, ok := result.Err.(gophercloud.ErrDefault404); !ok {
  			return fmt.Errorf("Error deleting object %s from container %s: %v", object, c.container, result.Err)
  		}
  	}
  	return nil
  
  }
docs: // Helper function to delete Swift objects within a container