Hello
I read somewhere there are similar bugs like this, but I am not sure about.
srcFile, err := sftpClient.Open(remotePath) this is a *sftp.File, not os.File
srcFileInfo, err2 := srcFile.Stat()
On calling STAT I get the following error and I can’t resolve it by myself
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x556d7d]
goroutine 25 [running]:
github.com/pkg/sftp.(*File).Stat(0x0)
/home/fabio/go/pkg/mod/github.com/pkg/sftp@v1.13.4/client.go:1403 +0x1d
main/myscript/goutil.downloadFile(0x0, 0xc00007f0e0, {0x7ffff08bc016, 0x17}, {0xc0001cba40, 0x48})
/home/fabio/golang-repo/main/myscript/goutil/Ssh.go:78 +0x7b
created by main/myscript/goutil.GetRemoteDirFiles
/home/fabio/golang-repo/main/myscript/goutil/Ssh.go:69 +0x333
Can you help me, please?
Thanks in advanced