From eebd8d3c0c40678a84f2e06243803ce1eeffb45f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 3 Apr 2022 16:20:34 +0200 Subject: [PATCH] opts: ParseTCPAddr(): remove workaround for go1.5 Current versions of Go no longer have a problem with the trailing colon when using url.Parse() or net.SplitHostPort(), so we can remove this workaround. Signed-off-by: Sebastiaan van Stijn --- opts/hosts.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/opts/hosts.go b/opts/hosts.go index aaa41ec97f..8ecb7346f8 100644 --- a/opts/hosts.go +++ b/opts/hosts.go @@ -132,13 +132,6 @@ func ParseTCPAddr(tryAddr string, defaultAddr string) (string, error) { if err != nil { return "", err } - // url.Parse fails for trailing colon on IPv6 brackets on Go 1.5, but - // not 1.4. See https://github.com/golang/go/issues/12200 and - // https://github.com/golang/go/issues/6530. - if strings.HasSuffix(addr, "]:") { - addr += defaultPort - } - u, err := url.Parse("tcp://" + addr) if err != nil { return "", err