Go version
go version 1.25.0 linux/amd64
Output of go env
in your module/workspace:
% go env
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v3'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/davidf/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/davidf/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3079630508=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/davidf/vimeo/go/src/github.com/vimeo/dials/go.mod'
GOMODCACHE='/home/davidf/vimeo/go/pkg/mod'
GONOPROXY='<redacted>'
GONOSUMDB='<redacted>'
GOOS='linux'
GOPATH='/home/davidf/vimeo/go'
GOPRIVATE='<redacted>'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go-1.25'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/davidf/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go-1.25/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.0'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
go doc -http Dials
(just needs to be a symbol that exists in the local package)
What did you see happen?
A browser opened at http://localhost:40853/github.com/vimeo/dials%23Dials
(%23
is #
hex-encoded)
It looks like the issue is that url.JoinPath
%-encodes anything in the path: https://cs.opensource.google/go/go/+/refs/tags/go1.25.0:src/cmd/internal/doc/main.go;l=217-218;drc=b4309ece66ca989a38ed65404850a49ae8f92742
What did you expect to see?
I expected it to open http://localhost:40853/github.com/vimeo/dials#Dials
.
Comment From: dfinkel
I've filed https://go.dev/cl/697435 to fix this in master. (backporting to go 1.25 would have to be manual because the code moved after the tree reopened for 1.26)
Comment From: gopherbot
Change https://go.dev/cl/697435 mentions this issue: cmd/doc: pass URL fragments separately with -http