As of Go 1.25, the go doc
subcommand directly includes the code that was previously in cmd/doc
, and no longer executes that command. While the doc tool could still be executed using go tool doc
it is really meant to be run using go doc
.
We plan to remove cmd/doc
, and also the ability to run go tool doc
in Go 1.26 since it's no longer necessary.
Comment From: gabyhelp
Related Issues
- x/tools/cmd/godoc: remove CLI support in Go 1.12 #25443 (closed)
- proposal: x/tools/{godoc,cmd/godoc}: isolate, tag, and delete godoc #59056
- cmd/doc: do not respect relative import paths that match standard commands #16183 (closed)
- x/tools/cmd/godoc: document as deprecated #49212 (closed)
- cmd/doc: load packages with golang.org/x/tools/go/packages #34750
Related Code Changes
Related Documentation
- Go 1.2 Release Notes > Changes to the implementations and tools > The go doc command is deleted
- Go 1.5 Release Notes > Tools > Go doc command
- Go 1.2 Release Notes > Changes to the implementations and tools > Godoc and vet moved to the go.tools subrepository
- Go 1.12 Release Notes > Tools > godoc and go doc
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)