ftp: Fix for go1.6 and go1.7

This commit is contained in:
Nick Craig-Wood 2017-05-16 20:19:03 +01:00
parent af043eda15
commit a9101f8608

View file

@ -134,10 +134,8 @@ func NewFs(name, root string) (ff fs.Fs, err error) {
fullPath = path.Join(u.Path, root) fullPath = path.Join(u.Path, root)
} }
root = fullPath root = fullPath
dialAddr := u.Hostname() dialAddr := u.Host
if u.Port() != "" { if strings.IndexRune(dialAddr, ':') < 0 {
dialAddr += ":" + u.Port()
} else {
dialAddr += ":21" dialAddr += ":21"
} }
f := &Fs{ f := &Fs{