Closed yamamoto-febc closed 7 years ago
Thanks for you report. Before I start to investigate the problem, I added two test cases to make sure what you mean. https://github.com/hnakamur/go-scp/commit/7e30af2bdde7adcc00e37ae05955d5538a200c37
Test results on my environment go version go1.8 linux/amd64
--- PASS: TestSendDir/send_only_files_case_#1 (0.20s)
--- FAIL: TestSendDir/send_only_files_case_#2 (0.15s)
source_test.go:443: unmatch entry count. got:2, want:0
Could you confirm these two test cases are representing your problem? Thanks!
Hi @hnakamur
Thanks for your response!!
I confirmed that two test cases are added, and I think that there are representing enough our problems.
FYI:
It is not included in the test case, but our problems also occurs on Windows.
My go env is go version go1.8 windows/amd64
Oh, sorry, I confirmed test cases again, there are not enough.
This problem occurs only when destination directory is not exists.
I will add test cases to cover there soon.
I added test cases for when destination directory is not exists.
ee5fda3879c15cd99ee903605096eb71aee3ecbf
And test results on my machine is:
--- PASS: TestSendDir/send_only_files_case_#1_dest_dir_exists (0.20s)
--- FAIL: TestSendDir/send_only_files_case_#2_dest_dir_exists (0.26s)
source_test.go:532: unmatch entry count. got:2, want:0
--- PASS: TestSendDir/send_only_files_case_#3_dest_dir_not_exists (0.25s)
--- FAIL: TestSendDir/send_only_files_case_#4_dest_dir_not_exists (0.16s)
source_test.go:382: fail to SendDir; failed to write scp file body: err=EOF
source_test.go:532: unmatch entry count. got:2, want:0
@yamamoto-febc Fixed. Thanks for your bug report and a test case!
You did awesome!!!!
Thank you 👍
I want to process only the files under the directory (except directories).
so I wrote following code.
It look like good. but, in some cases, the following error occurs.
It seems to be caused by the order of files and directories.
In the case of the following, when local path is
example1
: successexample2
: error occursIs there any solution to fix this problem?