switch parameters of downloadtofile
This commit is contained in:
parent
d97d95ed29
commit
90649f2263
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user