Fixed a typo so that we are no longer ignoring an error and am now using path.Join instead of fmt.Sprintf()
This commit is contained in:
parent
74a8c4bcbc
commit
37a04759dd
@ -1,7 +1,7 @@
|
|||||||
package ftp
|
package ftp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
pa "path"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ func (w *Walker) Next() bool {
|
|||||||
if w.descend && w.cur.err == nil && w.cur.entry.Type == EntryTypeFolder {
|
if w.descend && w.cur.err == nil && w.cur.entry.Type == EntryTypeFolder {
|
||||||
list, err := w.serverConn.List(w.cur.path)
|
list, err := w.serverConn.List(w.cur.path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.cur.err = nil
|
w.cur.err = err
|
||||||
w.stack = append(w.stack, w.cur)
|
w.stack = append(w.stack, w.cur)
|
||||||
} else {
|
} else {
|
||||||
for i := len(list) - 1; i >= 0; i-- {
|
for i := len(list) - 1; i >= 0; i-- {
|
||||||
@ -37,7 +37,7 @@ func (w *Walker) Next() bool {
|
|||||||
|
|
||||||
var path string
|
var path string
|
||||||
if list[i].Type == EntryTypeFolder {
|
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 {
|
} else {
|
||||||
path = w.cur.path
|
path = w.cur.path
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user