summaryrefslogtreecommitdiff
path: root/src/cmd/api/goapi_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2015-04-10 17:50:06 -0700
committerRobert Griesemer <gri@golang.org>2015-04-15 02:28:53 +0000
commite5b76747c9f30a736c38137ad7f5939c02b3e285 (patch)
treea3da1b4dae9c3512d4e99431772a4eb9eee5b3fb /src/cmd/api/goapi_test.go
parent2d0c962b1c13e451d0cce79032c92551c607b1bd (diff)
downloadgo-git-e5b76747c9f30a736c38137ad7f5939c02b3e285.tar.gz
go/importer: added go/importer package, adjusted go/types
- The go/importer package provides access to compiler-specific importers. - Adjusted go/internal/gcimporter and go/types as needed. - types.Check was removed - not much simpler than calling types.Config.Check. - Package "unsafe" is now handled by the type checker; importers are not called for it anymore. - In std lib tests, re-use importer for faster testing (no need to re-import previously imported packages). - Minor cleanups. The code still needs cleanups before submitting. Change-Id: Idd456da2e9641688fe056504367348926feb0755 Reviewed-on: https://go-review.googlesource.com/8767 Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/api/goapi_test.go')
-rw-r--r--src/cmd/api/goapi_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go
index 00c45c3bcd..6184e14477 100644
--- a/src/cmd/api/goapi_test.go
+++ b/src/cmd/api/goapi_test.go
@@ -39,7 +39,8 @@ func TestGolden(t *testing.T) {
// TODO(gri) remove extra pkg directory eventually
goldenFile := filepath.Join("testdata", "src", "pkg", fi.Name(), "golden.txt")
w := NewWalker(nil, "testdata/src/pkg")
- w.export(w.Import(fi.Name()))
+ pkg, _ := w.Import(fi.Name())
+ w.export(pkg)
if *updateGolden {
os.Remove(goldenFile)
@@ -178,7 +179,8 @@ func BenchmarkAll(b *testing.B) {
w := NewWalker(context, filepath.Join(build.Default.GOROOT, "src"))
for _, name := range pkgNames {
if name != "unsafe" && !strings.HasPrefix(name, "cmd/") {
- w.export(w.Import(name))
+ pkg, _ := w.Import(name)
+ w.export(pkg)
}
}
w.Features()