code: func (d *downloader) Download(url *url.URL, targetFile string) (*git.SourceInfo, error) {
  	r := d.schemeReaders[url.Scheme]
  	info := &git.SourceInfo{}
  	if r == nil {
  		glog.Errorf("No URL handler found for %s", url.String())
  		return nil, s2ierr.NewURLHandlerError(url.String())
  	}
  
  	reader, err := r.Read(url)
  	if err != nil {
  		return nil, err
  	}
  	defer reader.Close()
  
  	out, err := os.Create(targetFile)
  	defer out.Close()
  
  	if err != nil {
  		glog.Errorf("Unable to create target file %s (%v)", targetFile, err)
  		return nil, err
  	}
  
  	if _, err = io.Copy(out, reader); err != nil {
  		os.Remove(targetFile)
  		glog.Warningf("Skipping file %s due to error copying from source: %v", targetFile, err)
  		return nil, err
  	}
  
  	glog.V(2).Infof("Downloaded '%s'", url.String())
  	info.Location = url.String()
  	return info, nil
  }
docs: // Download downloads the file pointed to by URL into local targetFile
  // Returns information a boolean flag informing whether any download/copy operation
  // happened and an error if there was a problem during that operation