From a9101f8608e0a4f0ca9874b978d92c9f1922c97f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 16 May 2017 20:19:03 +0100 Subject: [PATCH] ftp: Fix for go1.6 and go1.7 --- ftp/ftp.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ftp/ftp.go b/ftp/ftp.go index 05c8b126c..fae675b4d 100644 --- a/ftp/ftp.go +++ b/ftp/ftp.go @@ -134,10 +134,8 @@ func NewFs(name, root string) (ff fs.Fs, err error) { fullPath = path.Join(u.Path, root) } root = fullPath - dialAddr := u.Hostname() - if u.Port() != "" { - dialAddr += ":" + u.Port() - } else { + dialAddr := u.Host + if strings.IndexRune(dialAddr, ':') < 0 { dialAddr += ":21" } f := &Fs{