Skip to content

Commit 4d00937

Browse files
committed
all: rename vendored golang.org/x/net packages to golang_org
Regression from Go 1.6 to Go 1.7rc1: we had broken the ability for users to vendor "golang.org/x/net/http2" or "golang.org/x/net/route" because we were vendoring them ourselves and cmd/go and cmd/compile do not understand multiple vendor directories across multiple GOPATH workspaces (e.g. user's $GOPATH and default $GOROOT). As a short-term fix, since fixing cmd/go and cmd/compile is too invasive at this point in the cycle, just rename "golang.org" to "golang_org" for the standard library's vendored copy. Fixes #16333 Change-Id: I9bfaed91e9f7d4ca6bab07befe80d71d437a21af Reviewed-on: https://go-review.googlesource.com/24902 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 1cb3f71 commit 4d00937

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+19
-19
lines changed

src/cmd/api/goapi.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (w *Walker) Import(name string) (*types.Package, error) {
425425
w.imported[name] = &importing
426426

427427
root := w.root
428-
if strings.HasPrefix(name, "golang.org/x/") {
428+
if strings.HasPrefix(name, "golang_org/x/") {
429429
root = filepath.Join(root, "vendor")
430430
}
431431

src/go/build/build_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ func TestImportVendor(t *testing.T) {
303303
testenv.MustHaveGoBuild(t) // really must just have source
304304
ctxt := Default
305305
ctxt.GOPATH = ""
306-
p, err := ctxt.Import("golang.org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
306+
p, err := ctxt.Import("golang_org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
307307
if err != nil {
308-
t.Fatalf("cannot find vendored golang.org/x/net/http2/hpack from net/http directory: %v", err)
308+
t.Fatalf("cannot find vendored golang_org/x/net/http2/hpack from net/http directory: %v", err)
309309
}
310-
want := "vendor/golang.org/x/net/http2/hpack"
310+
want := "vendor/golang_org/x/net/http2/hpack"
311311
if p.ImportPath != want {
312312
t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want)
313313
}
@@ -333,7 +333,7 @@ func TestImportVendorParentFailure(t *testing.T) {
333333
ctxt := Default
334334
ctxt.GOPATH = ""
335335
// This import should fail because the vendor/golang.org/x/net/http2 directory has no source code.
336-
p, err := ctxt.Import("golang.org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
336+
p, err := ctxt.Import("golang_org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
337337
if err == nil {
338338
t.Fatalf("found empty parent in %s", p.Dir)
339339
}

src/go/build/deps_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ var pkgDeps = map[string][]string{
297297
"context", "math/rand", "os", "sort", "syscall", "time",
298298
"internal/nettrace",
299299
"internal/syscall/windows", "internal/singleflight", "internal/race",
300-
"golang.org/x/net/route",
300+
"golang_org/x/net/route",
301301
},
302302

303303
// NET enables use of basic network-related packages.
@@ -378,8 +378,8 @@ var pkgDeps = map[string][]string{
378378
"context", "compress/gzip", "container/list", "crypto/tls",
379379
"mime/multipart", "runtime/debug",
380380
"net/http/internal",
381-
"golang.org/x/net/http2/hpack",
382-
"golang.org/x/net/lex/httplex",
381+
"golang_org/x/net/http2/hpack",
382+
"golang_org/x/net/lex/httplex",
383383
"internal/nettrace",
384384
"net/http/httptrace",
385385
},
@@ -443,7 +443,7 @@ func listStdPkgs(goroot string) ([]string, error) {
443443
}
444444

445445
name := filepath.ToSlash(path[len(src):])
446-
if name == "builtin" || name == "cmd" || strings.Contains(name, ".") {
446+
if name == "builtin" || name == "cmd" || strings.Contains(name, "golang_org") {
447447
return filepath.SkipDir
448448
}
449449

src/net/http/h2_bundle.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/net/http/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package http
77
import (
88
"strings"
99

10-
"golang.org/x/net/lex/httplex"
10+
"golang_org/x/net/lex/httplex"
1111
)
1212

1313
// maxInt64 is the effective "infinite" value for the Server and

src/net/http/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"sync/atomic"
2929
"time"
3030

31-
"golang.org/x/net/lex/httplex"
31+
"golang_org/x/net/lex/httplex"
3232
)
3333

3434
// Errors used by the HTTP server.

src/net/http/transfer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strings"
1919
"sync"
2020

21-
"golang.org/x/net/lex/httplex"
21+
"golang_org/x/net/lex/httplex"
2222
)
2323

2424
// ErrLineTooLong is returned when reading request or response bodies

src/net/http/transport.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"sync"
2828
"time"
2929

30-
"golang.org/x/net/lex/httplex"
30+
"golang_org/x/net/lex/httplex"
3131
)
3232

3333
// DefaultTransport is the default implementation of Transport and is

src/net/interface_bsd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package net
99
import (
1010
"syscall"
1111

12-
"golang.org/x/net/route"
12+
"golang_org/x/net/route"
1313
)
1414

1515
// If the ifindex is zero, interfaceTable returns mappings of all

src/net/interface_bsdvar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package net
99
import (
1010
"syscall"
1111

12-
"golang.org/x/net/route"
12+
"golang_org/x/net/route"
1313
)
1414

1515
func interfaceMessages(ifindex int) ([]route.Message, error) {

src/net/interface_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package net
77
import (
88
"syscall"
99

10-
"golang.org/x/net/route"
10+
"golang_org/x/net/route"
1111
)
1212

1313
func interfaceMessages(ifindex int) ([]route.Message, error) {

src/net/interface_freebsd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package net
77
import (
88
"syscall"
99

10-
"golang.org/x/net/route"
10+
"golang_org/x/net/route"
1111
)
1212

1313
func interfaceMessages(ifindex int) ([]route.Message, error) {

0 commit comments

Comments
 (0)