From a4b143bc22ff471a96c42458833998151df70cc0 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Sat, 19 Sep 2015 06:59:06 -0400 Subject: [PATCH] go/types: skip $GOROOT/src/*.go in TestStdlib Change-Id: I4a75d98a48675e2beb5b4843fb2c6ff5d4c8d2a2 Reviewed-on: https://go-review.googlesource.com/14769 Reviewed-by: Robert Griesemer --- src/go/types/stdlib_test.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/go/types/stdlib_test.go b/src/go/types/stdlib_test.go index 09f2585bcf8..97e6a69521e 100644 --- a/src/go/types/stdlib_test.go +++ b/src/go/types/stdlib_test.go @@ -266,13 +266,16 @@ func walkDirs(t *testing.T, dir string) { } // typecheck package in directory - files, err := pkgFilenames(dir) - if err != nil { - t.Error(err) - return - } - if files != nil { - typecheck(t, dir, files) + // but ignore files directly under $GOROOT/src (might be temporary test files). + if dir != filepath.Join(runtime.GOROOT(), "src") { + files, err := pkgFilenames(dir) + if err != nil { + t.Error(err) + return + } + if files != nil { + typecheck(t, dir, files) + } } // traverse subdirectories, but don't walk into testdata