aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2015-10-14 20:41:36 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2015-10-14 23:21:57 +0000
commit20736fcab966412cb41b8a3c9a051469a5c8f00c (patch)
treeb68b3c9fcdd490ed39d475988983d646552bbe4b /src/cmd/api
parent7a3dcd2d0f3e311e6f18edf841862ad4b8f90b51 (diff)
downloadgo-20736fcab966412cb41b8a3c9a051469a5c8f00c.tar.gz
go-20736fcab966412cb41b8a3c9a051469a5c8f00c.zip
net/http: enable automatic HTTP/2 if TLSNextProto is nil
This enables HTTP/2 by default (for https only) if the user didn't configure anything in their NPN/ALPN map. If they're using SPDY or an alternate http2 or a newer http2 from x/net/http2, we do nothing and don't use the standard library's vendored copy of x/net/http2. Upstream remains golang.org/x/net/http2. Update #6891 Change-Id: I69a8957a021a00ac353f9d7fdb9a40a5b69f2199 Reviewed-on: https://go-review.googlesource.com/15828 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/api')
-rw-r--r--src/cmd/api/goapi.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go
index 01b6defb5f..5d1cf05e31 100644
--- a/src/cmd/api/goapi.go
+++ b/src/cmd/api/goapi.go
@@ -428,10 +428,15 @@ func (w *Walker) Import(name string) (*types.Package, error) {
}
w.imported[name] = &importing
+ root := w.root
+ if strings.HasPrefix(name, "golang.org/x/") {
+ root = filepath.Join(root, "vendor")
+ }
+
// Determine package files.
- dir := filepath.Join(w.root, filepath.FromSlash(name))
+ dir := filepath.Join(root, filepath.FromSlash(name))
if fi, err := os.Stat(dir); err != nil || !fi.IsDir() {
- log.Fatalf("no source in tree for package %q", pkg)
+ log.Fatalf("no source in tree for import %q: %v", name, err)
}
context := w.context