You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like go doc invokes go tool doc which invokes go list.
So far so good.
But go list should not need to use the network:
all I want is the docs for the package in the current directory.
We should remove the network usage.
cmd/doc is using go list -m because it is doing the same kind of fuzzy searching that gopls and goimports use: it can't just go list a specific package because it doesn't know which package you want.
go list -m needs network access because it collects all of the information about a module needed for the complete JSON output even if the user is only requesting a few locally-available fields (#29666, #29869, #42723). So I think in the general case this is a duplicate of #29666, which is going to require a fair amount of work to fix.
That said, for the specific case where the exact package directory is known, cmd/doc should probably skip go list -m all (which unnecessarily loads the full module graph), and instead go list only that specific package.
I made this change to my repo and did
go install cmd/go
.Then I did
cd $GOPATH/src/golang.org/x/mod/semver; go doc
, and I get:It looks like
go doc
invokesgo tool doc
which invokesgo list
.So far so good.
But
go list
should not need to use the network:all I want is the docs for the package in the current directory.
We should remove the network usage.
/cc @bcmills @jayconrod @matloob
The text was updated successfully, but these errors were encountered: