From 751ce5bf6af90351ea15c4a780d77639c85ae475 Mon Sep 17 00:00:00 2001 From: dom Date: Sun, 26 Jul 2020 20:25:56 +0200 Subject: [PATCH] fix bug only fist file is been downloaded --- ftpActions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftpActions.go b/ftpActions.go index bb6aceb..e940ef8 100644 --- a/ftpActions.go +++ b/ftpActions.go @@ -36,7 +36,6 @@ func DownloadFTP(user string, password string, path string) error { if err != nil { return err } - defer res.Close() outFile, err := os.Create(filepath.Join(path, file.Name)) if err != nil { @@ -49,6 +48,7 @@ func DownloadFTP(user string, password string, path string) error { return err } + res.Close() } return nil