]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/syntax: don't try to parse files in GOROOT/.git
authorBryan C. Mills <bcmills@google.com>
Fri, 4 Mar 2022 22:17:56 +0000 (17:17 -0500)
committerBryan Mills <bcmills@google.com>
Tue, 8 Mar 2022 21:00:10 +0000 (21:00 +0000)
commite030833880b4ed20a7c153e6e58190c5649284ac
tree110984f136642aeaf33f7b30074aad6a1b58654c
parent7419bb3ebb8ea2b9b3745cdcbaf747e4dffc52ae
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 <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/syntax/parser_test.go