Merge pull request #17418 from diogomonica/bump-go-1.5

Bump go 1.5
This commit is contained in:
Jess Frazelle 2015-10-27 20:12:43 -07:00
commit be7bdc5be2

View file

@ -74,6 +74,18 @@ func ParseTCPAddr(tryAddr string, defaultAddr string) (string, error) {
return "", fmt.Errorf("Invalid proto, expected tcp: %s", tryAddr)
}
defaultAddr = strings.TrimPrefix(defaultAddr, "tcp://")
defaultHost, defaultPort, err := net.SplitHostPort(defaultAddr)
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
@ -84,12 +96,6 @@ func ParseTCPAddr(tryAddr string, defaultAddr string) (string, error) {
return "", fmt.Errorf("Invalid bind address format: %s", tryAddr)
}
defaultAddr = strings.TrimPrefix(defaultAddr, "tcp://")
defaultHost, defaultPort, err := net.SplitHostPort(defaultAddr)
if err != nil {
return "", err
}
if host == "" {
host = defaultHost
}