fix bug only fist file is been downloaded

This commit is contained in:
dom 2020-07-26 20:25:56 +02:00
parent a356f0346f
commit 751ce5bf6a
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,6 @@ func DownloadFTP(user string, password string, path string) error {
if err != nil { if err != nil {
return err return err
} }
defer res.Close()
outFile, err := os.Create(filepath.Join(path, file.Name)) outFile, err := os.Create(filepath.Join(path, file.Name))
if err != nil { if err != nil {
@ -49,6 +48,7 @@ func DownloadFTP(user string, password string, path string) error {
return err return err
} }
res.Close()
} }
return nil return nil