switch parameters of downloadtofile

This commit is contained in:
gutmet 2019-02-12 19:01:18 +01:00
parent d97d95ed29
commit 90649f2263

View File

@ -326,13 +326,13 @@ func DownloadAll(url string) ([]byte, error) {
return data, err return data, err
} }
func DownloadToFile(f string, url string) error { func DownloadToFile(url string, dest string) error {
resp, err := http.Get(url) resp, err := http.Get(url)
if err != nil { if err != nil {
return errors.New("DownloadToFile: " + err.Error()) return errors.New("DownloadToFile: " + err.Error())
} }
defer resp.Body.Close() defer resp.Body.Close()
file, err := os.Create(f) file, err := os.Create(dest)
if err != nil { if err != nil {
return errors.New("DownloadToFile: " + err.Error()) return errors.New("DownloadToFile: " + err.Error())
} }