add logging
This commit is contained in:
parent
880d06b1b8
commit
1adfc456be
|
@ -1,7 +1,9 @@
|
|||
package paxan
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
@ -28,6 +30,8 @@ func DownloadFTP(user string, password string, path string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("%v", files)
|
||||
|
||||
for _, file := range files {
|
||||
res, err := c.Retr(file.Name)
|
||||
if err != nil {
|
||||
|
@ -35,6 +39,8 @@ func DownloadFTP(user string, password string, path string) error {
|
|||
}
|
||||
defer res.Close()
|
||||
|
||||
log.Printf("Downloading %s", file.Name)
|
||||
|
||||
outFile, err := os.Create(filepath.Join(path, file.Name))
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue