Commit 92eb9aea authored by Robert Griesemer's avatar Robert Griesemer

go/types: move go/types/internal/gcimport => go/internal/gcimporter

This will make it possible to access the gcimporter (and gccgoimporter,
eventually) from the forthcoming gc/importer package, without exposing
compiler names in package names.

This change was created by manually adjusting the gcimporter paths in
go/types.bash and then running sh go/types.bash (i.e., by revendoring
gcimporter). The only manual changes are in go/types.bash.

Change-Id: Idc282439742288c09caa58b3a66d77aec0325faf
Reviewed-on: https://go-review.googlesource.com/8764Reviewed-by: default avatarRob Pike <r@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
parent 2539ccb8
......@@ -4,7 +4,7 @@
// Package gcimporter implements Import for gc-generated object files.
// Importing this package installs Import as go/types.DefaultImport.
package gcimporter // import "go/types/internal/gcimporter"
package gcimporter // import "go/internal/gcimporter"
import (
"bufio"
......
......@@ -40,7 +40,7 @@ function vendor() (
# copy $f and update imports
sed -e 's|"golang.org/x/tools/go/exact"|"go/exact"|' \
-e 's|"golang.org/x/tools/go/types"|"go/types"|' \
-e 's|"golang.org/x/tools/go/gcimporter"|"go/types/internal/gcimporter"|' \
-e 's|"golang.org/x/tools/go/gcimporter"|"go/internal/gcimporter"|' \
$f | gofmt > tmp.go
mv -f tmp.go `basename $f`
done
......@@ -81,9 +81,9 @@ vendor go/types types
install types
### go/gcimporter
vendor go/gcimporter types/internal/gcimporter
test types/internal/gcimporter
install types/internal/gcimporter
vendor go/gcimporter internal/gcimporter
test internal/gcimporter
install internal/gcimporter
### test go/types (requires gcimporter)
test types
......
......@@ -122,7 +122,7 @@ type Config struct {
// DefaultImport is the default importer invoked if Config.Import == nil.
// The declaration:
//
// import _ "go/types/internal/gcimporter"
// import _ "go/internal/gcimporter"
//
// in a client of go/types will initialize DefaultImport to gcimporter.Import.
var DefaultImport Importer
......
......@@ -14,8 +14,8 @@ import (
"strings"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
// skipSpecialPlatforms causes the test to be skipped for platforms where
......
......@@ -10,8 +10,8 @@ import (
"go/parser"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
var builtinCalls = []struct {
......
......@@ -36,8 +36,8 @@ import (
"strings"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
var (
......
......@@ -13,8 +13,8 @@ import (
"strings"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
func testEval(t *testing.T, pkg *Package, scope *Scope, str string, typ Type, typStr, valStr string) {
......
......@@ -14,8 +14,8 @@ import (
"strings"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
func TestIssue5770(t *testing.T) {
......
......@@ -135,7 +135,7 @@ func (check *Checker) collectObjects() {
} else {
// Panic if we encounter an import.
importer = func(map[string]*Package, string) (*Package, error) {
panic(`no Config.Import or DefaultImport (missing import _ "go/types/internal/gcimporter"?)`)
panic(`no Config.Import or DefaultImport (missing import _ "go/internal/gcimporter"?)`)
}
}
}
......
......@@ -12,8 +12,8 @@ import (
"sort"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
var sources = []string{
......
......@@ -14,8 +14,8 @@ import (
"testing"
"time"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
var benchmark = flag.Bool("b", false, "run benchmarks")
......
......@@ -22,8 +22,8 @@ import (
"testing"
"time"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
var (
......
......@@ -10,8 +10,8 @@ import (
"go/token"
"testing"
_ "go/internal/gcimporter"
. "go/types"
_ "go/types/internal/gcimporter"
)
const filename = "<src>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment