Skip to content

cmd/go: doc -http fails with "doc: no such file or directory" on first run with clean GOCACHE #80287

Description

@dmitshur

Go version

go version go1.27rc1 darwin/arm64

Output of go env in your module/workspace:

(go env -changed is empty.)

What did you do?

$ export GOCACHE=$(mktemp -d)       
$ go doc -http

(I ran into this while naturally using Go 1.27 without going out of my way to clear my GOCACHE; I'm including that in the "what did I do" section to make it reproducible.)

What did you see happen?

$ go doc -http  # first run
doc: fork/exec /var/folders/s_/5sjqzr0j6xggz_xtzmq_8r4m00jwcj/T/go-build725967369/b001/exe/doc: no such file or directory
$ echo $?
1

$ go doc -http  # second run
doc: Documentation server listening on addr http://localhost:64979

What did you expect to see?

I'd expect it should work error-free on the first run too.

This seems to be a regression from Go 1.26, might be related to CL 763760.

CC @golang/command-line.

Metadata

Metadata

Assignees

Labels

FixPendingIssues that have a fix which has not yet been reviewed or submitted.GoCommandcmd/gorelease-blocker

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions