-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
This is the tracking issue specifically for the golang.org/x/tools/cmd/godoc
command to have support for displaying package documentation in module mode. The parent umbrella issue for all “godoc”-like projects is #26827.
At this time, the godoc
command is only able to display packages that are located in a GOPATH workspace. When invoked in module mode, it should be able to show documentation for packages in the build list of the main module (as can be determined by running go list -m all
), even if those packages are not inside a GOPATH workspace.
The plan is to make this change while maintaining GOPATH support. godoc
will use the same logic as the go
command to determine whether to use module mode or GOPATH mode (i.e., the value of GO111MODULE
environment variable and the presence of a go.mod file).
Scope
There may be future enhancements to add features that weren’t previously viable in GOPATH mode, like being able to select the version via a dropdown UI element, but that’s not in scope for this issue.
This issue is only about maintaining the ability to view the documentation for packages when in module mode.
The -analysis
flag is not in scope of this issue, since it's not required to view documentation. It will take more work and is being tracked separately in issue #34473.