-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8.3
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=d:\project
set GORACE=
set GOROOT=d:\SDK\go
set GOTOOLDIR=d:\SDK\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
package main
import (
"net/url"
"fmt"
"os"
)
func main() {
addr := "10.88.237.69:4222"
u, err := url.Parse(addr)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
fmt.Println(u.Hostname(), u.Port())
}A link on play.golang.org is best.
https://play.golang.org/p/AxIZvVA7fm
What did you expect to see?
err == nil
I think 10.88.237.69:4222 is a validate URL.
What did you see instead?
parse 10.88.237.69:4222: first path segment in URL cannot contain colon