From 37a04759dd46afeea20c5289af4b5a3f0de14542 Mon Sep 17 00:00:00 2001 From: johnepiscopo Date: Tue, 10 Mar 2020 14:26:54 +0000 Subject: [PATCH] Fixed a typo so that we are no longer ignoring an error and am now using path.Join instead of fmt.Sprintf() --- walker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/walker.go b/walker.go index e5f48f4..dacd0d8 100644 --- a/walker.go +++ b/walker.go @@ -1,7 +1,7 @@ package ftp import ( - "fmt" + pa "path" "strings" ) @@ -27,7 +27,7 @@ func (w *Walker) Next() bool { if w.descend && w.cur.err == nil && w.cur.entry.Type == EntryTypeFolder { list, err := w.serverConn.List(w.cur.path) if err != nil { - w.cur.err = nil + w.cur.err = err w.stack = append(w.stack, w.cur) } else { for i := len(list) - 1; i >= 0; i-- { @@ -37,7 +37,7 @@ func (w *Walker) Next() bool { var path string if list[i].Type == EntryTypeFolder { - path = fmt.Sprintf("%s%s", w.cur.path, list[i].Name) + path = pa.Join(w.cur.path, list[i].Name) } else { path = w.cur.path }