aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/mathbits.go
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2022-11-02 14:36:51 -0400
committerMichael Matloob <matloob@golang.org>2022-11-03 19:34:40 +0000
commit3511c822f766fdf16817c1a1949971806c4eeb7e (patch)
tree787286e2dbad1a56007638e33f4c8eda5170ac84 /test/codegen/mathbits.go
parent44cabb802af220388aa1d74776e076e75c53aeb0 (diff)
downloadgo-3511c822f766fdf16817c1a1949971806c4eeb7e.tar.xz
go/build: don't add unparsable non-Go files to InvalidGoFiles
go/build attempts to parse comments at the beginning of non-Go files looking for //go:build or //+go build comments. Before this change, if the beginning of the non-Go file failed to parse (perhaps because it is in a format that isn't even meant to be built with Go code) the file would be added to InvalidGoFiles. The comment for InvalidGoFiles states that it contains Go files, so this is clearly incorrect behavior. Further, if there was a directory that only contained these unparsable non-Go files, it would have a non-zero number of InvalidGoFiles, and the matching code in cmd/go/internal/search/search.go in (*Match).MatchDirs would treat it as a directory containing (invalid) Go files and would match the directory as a Go package. This incorrect behavior is also fixed by this CL. Fixes #56509 Change-Id: Id0d905827c71f7927f7c2fa42b236181950af7e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/447357 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'test/codegen/mathbits.go')
0 files changed, 0 insertions, 0 deletions