code: func (d *downloader) DownloadFile(url string) (int64, string, error) {
  	c := http.Client{
  		CheckRedirect: func(r *http.Request, via []*http.Request) error {
  			r.URL.Opaque = r.URL.Path
  
  			//some redirect return '/' as url
  			if strings.Trim(r.URL.Opaque, "/") != "" {
  				url = r.URL.Opaque
  			}
  
  			return nil
  		},
  	}
  
  	r, err := c.Get(url)
  
  	if err != nil {
  		return 0, "", err
  	}
  	defer r.Body.Close()
  
  	if r.StatusCode == 200 {
  		d.filename = getFilenameFromHeader(r.Header.Get("Content-Disposition"))
  
  		if d.filename == "" {
  			d.filename = getFilenameFromURL(url)
  		}
  
  		f, err := os.Create(filepath.Join(d.saveDir, d.filename))
  		if err != nil {
  			return 0, "", err
  		}
  		defer f.Close()
  
  		size, err := io.Copy(f, r.Body)
  		if err != nil {
  			return 0, "", err
  		}
  
  		d.downloaded = true
  		return size, d.filename, nil
  
  	}
  	return 0, "", fmt.Errorf("Error downloading file from %s", url)
  }
docs: //this func returns byte written, filename and error