File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ func main() {
3434 log .Fatalf ("Failed to parse input %v" , err )
3535 }
3636
37- if source_map_kv ["scheme" ] == "ftp" && destination_map_kv ["scheme" ] == "ftp" {
37+ if utils . SchemeValidator ( source_map_kv ["scheme" ], destination_map_kv ["scheme" ], "ftp" ) {
3838 log .Println ("Source and Destination are ftp endpoints" )
3939
4040 // validate ftp parameters : panic on failure
@@ -45,7 +45,7 @@ func main() {
4545
4646 utils .FtpClientHandler (source_map_kv , destination_map_kv , bsvalue )
4747 }
48- if source_map_kv ["scheme" ] == "sftp" && destination_map_kv ["scheme" ] == "sftp" {
48+ if utils . SchemeValidator ( source_map_kv ["scheme" ], destination_map_kv ["scheme" ], "sftp" ) {
4949 log .Println ("Source and Destination are ftp endpoints" )
5050
5151 // validate ftp parameters : panic on failure
Original file line number Diff line number Diff line change @@ -47,10 +47,11 @@ func NullChecker(key string, ftpurl string) {
4747 }
4848}
4949
50- func SchemeValidator (scheme string ) bool {
51- log .Printf ("scheme: %s" , scheme )
52- if scheme == "ftp" {
53- return true
50+ func SchemeValidator (source , dest , key string ) bool {
51+ if source == dest {
52+ if source == key {
53+ return true
54+ }
5455 }
5556 return false
5657}
You can’t perform that action at this time.
0 commit comments