From 90649f226317d2f098bfa60d3a96818135d4beaa Mon Sep 17 00:00:00 2001 From: gutmet Date: Tue, 12 Feb 2019 19:01:18 +0100 Subject: [PATCH] switch parameters of downloadtofile --- goutil.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goutil.go b/goutil.go index 30bce51..afdab06 100644 --- a/goutil.go +++ b/goutil.go @@ -326,13 +326,13 @@ func DownloadAll(url string) ([]byte, error) { return data, err } -func DownloadToFile(f string, url string) error { +func DownloadToFile(url string, dest string) error { resp, err := http.Get(url) if err != nil { return errors.New("DownloadToFile: " + err.Error()) } defer resp.Body.Close() - file, err := os.Create(f) + file, err := os.Create(dest) if err != nil { return errors.New("DownloadToFile: " + err.Error()) }