code: func (d *Data) URLFileName(targetDir, url string) string {
  	token := strings.Split(url, "/")
  
  	// get of filename from url
  	var original string
  	for i := 1; original == ""; i++ {
  		original = token[len(token)-i]
  	}
  
  	filename := original
  
  	// create unique filename
  	for i := 1; true; i++ {
  		var filePath string
  		if targetDir == "" {
  			filePath = filename
  		} else {
  			filePath = fmt.Sprintf("%s/%s", targetDir, filename)
  		}
  
  		if _, err := os.Stat(filePath); err == nil {
  			filename = fmt.Sprintf("%s-%d", original, i)
  		} else {
  			break
  		}
  	}
  
  	return filename
  }
docs: // URLFileName set to Data structs member using url