Skip to content

Commit e030833

Browse files
author
Bryan C. Mills
committed
cmd/compile/internal/syntax: don't try to parse files in GOROOT/.git
This test was failing locally in my clone of the go repo due to a Git branch ending in ".go", which the test found and was attempting to parse as a file. It's fragile to try to parse .go files in GOROOT/.git, and wasteful to scan GOROOT/pkg and other non-source directories; instead, let's only parse the directories we actually expect to contain source files. (I was running the test for #51461.) Change-Id: I5d4e31ec2bcd9b4b6840ec32ad9b12bf44f349a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/390023 Trust: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 7419bb3 commit e030833

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/compile/internal/syntax/parser_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ func TestStdLib(t *testing.T) {
7878
go func() {
7979
defer close(results)
8080
for _, dir := range []string{
81-
runtime.GOROOT(),
81+
filepath.Join(runtime.GOROOT(), "src"),
82+
filepath.Join(runtime.GOROOT(), "misc"),
8283
} {
8384
walkDirs(t, dir, func(filename string) {
8485
if skipRx != nil && skipRx.MatchString(filename) {

0 commit comments

Comments
 (0)