// downloadFile is a helper function to download a file from url to the filepath
downloadFile is a helper function to download a file from url to the filepath
// downloadFile is a helper function to download a file from url to the filepath
func downloadFile(filepath string, url string) error {
	resp, err := http.Get(url)
	if err != nil {
		return err
	}
	defer fs.CheckClose(resp.Body, &err)
	out, err := os.Create(filepath)
	if err != nil {
		return err
	}
	defer fs.CheckClose(out, &err)
	_, err = io.Copy(out, resp.Body)
	return err
}
func downloadFile ( filepath string , url string ) error { resp , err := http . Get ( url ) if err != nil { return err } defer fs . CheckClose ( resp . Body , & err ) out , err := os . Create ( filepath ) if err != nil { return err } defer fs . CheckClose ( out , & err ) _ , err = io . Copy ( out , resp . Body ) return err }
downloadFile is a helper function to download a file from url to the filepath
downloadFile is a helper function to download a file from url to the filepath
// Get the data // Create the file // Write the body to file