Go version
go version go1.25.0 darwin/arm6
Output of go env in your module/workspace:
AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/viktigpetterr/go/bin'
GOCACHE='/Users/viktigpetterr/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/viktigpetterr/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/78/__zfw80925vgr6jyj1rw514m0000gn/T/go-build3038274493=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/viktigpetterr/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/viktigpetterr/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/opt/go/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/viktigpetterr/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.0'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
I used url.Parse and url.ParseRequestURI to parse an URL with a trailing colon http://127.0.0.1:8080:.
https://go.dev/play/p/7KST83BAnsD
What did you see happen?
The URL was successfully parsed by both functions where I would expect them to return errors.
What did you expect to see?
I expected url.Parse and url.ParseRequestURI to return an error.
The docs state that net/url generally follows RFC 3986. To me, the trailing colon looks like a violation to the port specification
Go version
go version go1.25.0 darwin/arm6
Output of
go envin your module/workspace:What did you do?
I used
url.Parseandurl.ParseRequestURIto parse an URL with a trailing colonhttp://127.0.0.1:8080:.https://go.dev/play/p/7KST83BAnsD
What did you see happen?
The URL was successfully parsed by both functions where I would expect them to return errors.
What did you expect to see?
I expected
url.Parseandurl.ParseRequestURIto return an error.The docs state that
net/urlgenerally follows RFC 3986. To me, the trailing colon looks like a violation to the port specification