Hi ,
I have to download files to local from remote using ftp
please suggest me if you have another option.
// Download each file into local memory, and calculate it's sha256 hash
err = ftp.Walk("/", func(path string, info os.FileMode, err error) error {
_, err = ftp.Retr(path, func(r io.Reader) error {
var hasher = sha256.New()
if _, err = io.Copy(hasher, r); err != nil {
return err
}
hash := fmt.Sprintf("%s %x", path, hex.EncodeToString(hasher.Sum(nil)))
fmt.Println(hash)
return err
})
return nil
})