Repository: go
Issue: cmd/go,cmd/doc: http activity during 'go doc'
Labels: NeedsFix,GoCommand

I made this change to my repo and did `go install cmd/go`.

```
diff --git a/src/net/http/client.go b/src/net/http/client.go
index e0cabc9d4c..9973cdcb23 100644
--- a/src/net/http/client.go
+++ b/src/net/http/client.go
@@ -590,6 +590,7 @@ func urlErrorOp(method string) string {
 // Any returned error will be of type *url.Error. The url.Error
 // value's Timeout method will report true if the request timed out.
 func (c *Client) Do(req *Request) (*Response, error) {
+	panic("HTTP")
 	return c.do(req)
 }

```

Then I did `cd $GOPATH/src/golang.org/x/mod/semver; go doc`, and I get:

```
% go doc
panic: HTTP

goroutine 1 [running]:
net/http.(*Client).Do(...)
	/Users/rsc/go/src/net/http/client.go:593
cmd/go/internal/web.get.func1(0xc00033e3f0)
	/Users/rsc/go/src/cmd/go/internal/web/http.go:112 +0x132
cmd/go/internal/web.get(0x1, 0xc0001c6480)
	/Users/rsc/go/src/cmd/go/internal/web/http.go:127 +0x509
cmd/go/internal/web.Get(...)
	/Users/rsc/go/src/cmd/go/internal/web/api.go:182
cmd/go/internal/modfetch.(*proxyRepo).getBody(0xc000322540, {0xc00030e5a0, 0x2a})
	/Users/rsc/go/src/cmd/go/internal/modfetch/proxy.go:260 +0x13e
cmd/go/internal/modfetch.(*proxyRepo).getBytes(0xc00011c150, {0xc00030e5a0, 0xc0001c65c0})
	/Users/rsc/go/src/cmd/go/internal/modfetch/proxy.go:245 +0x4b
cmd/go/internal/modfetch.(*proxyRepo).Stat(0xc000322540, {0xc00011c150, 0xc00011c150})
	/Users/rsc/go/src/cmd/go/internal/modfetch/proxy.go:353 +0x8b
cmd/go/internal/modfetch.(*cachingRepo).Stat.func1()
	/Users/rsc/go/src/cmd/go/internal/modfetch/cache.go:230 +0x82
cmd/go/internal/par.(*Cache).Do(0xc0003162b0, {0x141d2c0, 0xc00030a340}, 0xc0001c67b8)
	/Users/rsc/go/src/cmd/go/internal/par/work.go:128 +0xc3
cmd/go/internal/modfetch.(*cachingRepo).Stat(0xc0003162a0, {0xc00011c150, 0x22})
	/Users/rsc/go/src/cmd/go/internal/modfetch/cache.go:224 +0x9d
cmd/go/internal/modload.queryProxy({0x1558140, 0xc0000261c8}, {0xc00002c0f8, 0x18}, {0xc00012c040, 0xc0001c6a88}, {0xc00011c150, 0x0}, {0x0, 0x0})
	/Users/rsc/go/src/cmd/go/internal/modload/query.go:139 +0xe35
cmd/go/internal/modload.Query.func1({0xc00002c0f8, 0xc000318e08})
	/Users/rsc/go/src/cmd/go/internal/modload/query.go:71 +0x6d
cmd/go/internal/modfetch.TryProxies(0xc0001c6b38)
	/Users/rsc/go/src/cmd/go/internal/modfetch/proxy.go:163 +0xb2
cmd/go/internal/modload.Query({0x1558140, 0xc0000261c8}, {0xc00012c040, 0x26}, {0xc00011c150, 0xe400000000000003}, {0x0, 0xc0001d20d0}, 0xc0001c6c48)
	/Users/rsc/go/src/cmd/go/internal/modload/query.go:70 +0xc5
cmd/go/internal/modload.moduleInfo.func1(0xc00033c300)
	/Users/rsc/go/src/cmd/go/internal/modload/build.go:250 +0xb0
cmd/go/internal/modload.moduleInfo({0x1558140, 0xc0000261c8}, 0xc000020370, {{0xc00012c040, 0xc0001c6f88}, {0xc00011c150, 0xc0001c6e58}}, 0x0)
	/Users/rsc/go/src/cmd/go/internal/modload/build.go:305 +0x60a
cmd/go/internal/modload.listModules({0x1558140, 0xc0000261c8}, 0xc000020370, {0xc0000200e0, 0x1, 0x0}, 0x0)
	/Users/rsc/go/src/cmd/go/internal/modload/list.go:225 +0x158d
cmd/go/internal/modload.ListModules({0x1558140, 0xc0000261c8}, {0xc0000200e0, 0x1, 0x1}, 0x0)
	/Users/rsc/go/src/cmd/go/internal/modload/list.go:38 +0x93
cmd/go/internal/list.runList({0x1558140, 0xc0000261c8}, 0xc0000284b0, {0xc0000200e0, 0x44, 0x1})
	/Users/rsc/go/src/cmd/go/internal/list/list.go:467 +0x279f
main.invoke(0x17d9aa0, {0xc0000200b0, 0x4, 0x4})
	/Users/rsc/go/src/cmd/go/main.go:216 +0x2f6
main.main()
	/Users/rsc/go/src/cmd/go/main.go:173 +0x78e
package semver // import "golang.org/x/mod/semver"

Package semver implements comparison of semantic version strings. In this
package, semantic version strings must begin with a leading "v", as in
"v1.0.0".
...
```

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.

/cc @bcmills @jayconrod @matloob