]> Cypherpunks repositories - gostls13.git/commit
cmd/go: cache results of HTTP requests done during meta tag discovery
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 10 Apr 2015 13:59:06 +0000 (15:59 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 13 Apr 2015 07:08:00 +0000 (07:08 +0000)
commitdc2d64bf81b3342d35bdbfa42b971087ade6dfc6
tree12c319c62687e90880ec7f6d2ecfd7ff96af5870
parentd1af6bed847291599985e85a8fbf207b6f0342a6
cmd/go: cache results of HTTP requests done during meta tag discovery

Previously, running

  $ go get -u -v golang.org/x/tools/cmd/godoc

would results in dozens of HTTP requests for

  https://golang.org/x/tools?go-get=1

once per package under x/tools.

Now it caches the results. We still end up doing one HTTP request for
all the packages under x/tools, but this reduces the total number of
HTTP requests in ~half.

This also moves the singleflight package back into an internal
package. singleflight was originally elsewhere as a package, then got
copied into "net" (without its tests). But now that we have internal,
put it in its own package, and restore its test.

Fixes #9249

Change-Id: Ieb5cf04fc4d0a0c188cb957efdc7ea3068c34e3f
Reviewed-on: https://go-review.googlesource.com/8727
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/dist/build.go
src/cmd/go/vcs.go
src/go/build/deps_test.go
src/internal/singleflight/singleflight.go [moved from src/net/singleflight.go with 73% similarity]
src/internal/singleflight/singleflight_test.go [new file with mode: 0644]
src/net/lookup.go