code: func (s *Service) Delete(publicId, prepend string, rtype ResourceType) error {
  	// TODO: also delete resource entry from database (if used)
  	timestamp := strconv.FormatInt(time.Now().Unix(), 10)
  	data := url.Values{
  		"api_key":   []string{s.apiKey},
  		"public_id": []string{prepend + publicId},
  		"timestamp": []string{timestamp},
  	}
  	if s.keepFilesPattern != nil {
  		if s.keepFilesPattern.MatchString(prepend + publicId) {
  			fmt.Println("keep")
  			return nil
  		}
  	}
  	if s.simulate {
  		fmt.Println("ok")
  		return nil
  	}
  
  	// Signature
  	hash := sha1.New()
  	part := fmt.Sprintf("public_id=%s&timestamp=%s%s", prepend+publicId, timestamp, s.apiSecret)
  	io.WriteString(hash, part)
  	data.Set("signature", fmt.Sprintf("%x", hash.Sum(nil)))
  
  	rt := imageType
  	if rtype == RawType {
  		rt = rawType
  	}
  	resp, err := http.PostForm(fmt.Sprintf("%s/%s/%s/destroy/", baseUploadUrl, s.cloudName, rt), data)
  	if err != nil {
  		return err
  	}
  
  	m, err := handleHttpResponse(resp)
  	if err != nil {
  		return err
  	}
  	if e, ok := m["result"]; ok {
  		fmt.Println(e.(string))
  	}
  	// Remove DB entry
  	if s.dbSession != nil {
  		if err := s.col.Remove(bson.M{"_id": prepend + publicId}); err != nil {
  			return errors.New("can't remove entry from DB: " + err.Error())
  		}
  	}
  	return nil
  }
docs: // Delete deletes a resource uploaded to Cloudinary.