Skip to content

cmd/go,x/pkgsite/cmd/internal/doc: go doc -http should support @version #78459

Description

@seankhliao

Go version

go version go1.27-devel_8fe9383c5a 2026-03-30 04:14:14 -0700 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='0'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v3'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT='jsonv2'
GOFIPS140='off'
GOFLAGS='-trimpath "-ldflags=-s -w" -vet=all'
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1829676716=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/user/tmp/testrepo1444/go.mod'
GOMODCACHE='/home/user/.data/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/.data/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/user/sdk/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='path'
GOTOOLDIR='/home/user/sdk/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.27-devel_8fe9383c5a 2026-03-30 04:14:14 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

go doc -http github.com/yuin/goldmark@latest

What did you see happen?

This page is not supported by this datasource.

What did you expect to see?

docs for the package.

without -http, go doc now works with @version:

go doc github.com/yuin/goldmark@latest
package goldmark // import "github.com/yuin/goldmark"

Package goldmark implements functions to convert markdown text to a desired
format.

func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error
func DefaultParser() parser.Parser
func DefaultRenderer() renderer.Renderer
type Extender interface{ ... }
type Markdown interface{ ... }
    func New(options ...Option) Markdown
type Option func(*markdown)
    func WithExtensions(ext ...Extender) Option
    func WithParser(p parser.Parser) Option
    func WithParserOptions(opts ...parser.Option) Option
    func WithRenderer(r renderer.Renderer) Option
    func WithRendererOptions(opts ...renderer.Option) Option

I think there's a similar issue when a module is added as a dependency in go.mod
but not as a build dependency.
go list and go doc will show it, but go doc -http won't.

cat go.mod
module go.seankhliao.com/testrepo1444

go 1.27

require github.com/yuin/goldmark v1.8.2 // indirect


master » go list -m -f '{{ .Path }} {{ .Version }}' github.com/yuin/goldmark
github.com/yuin/goldmark v1.8.2


go doc github.com/yuin/goldmark
package goldmark // import "github.com/yuin/goldmark"

Package goldmark implements functions to convert markdown text to a desired
format.

func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error
func DefaultParser() parser.Parser
func DefaultRenderer() renderer.Renderer
type Extender interface{ ... }
type Markdown interface{ ... }
    func New(options ...Option) Markdown
type Option func(*markdown)
    func WithExtensions(ext ...Extender) Option
    func WithParser(p parser.Parser) Option
    func WithParserOptions(opts ...parser.Option) Option
    func WithRenderer(r renderer.Renderer) Option
    func WithRendererOptions(opts ...renderer.Option) Option
19:43:46 ~/tmp/testrepo1444 0:00:00

go doc -http github.com/yuin/goldmark
# This page is not supported by this datasource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.ToolProposalIssues describing a requested change to a Go tool or command-line program.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions