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