]> Cypherpunks repositories - gostls13.git/commit
go/build: include files with parse errors in GoFiles and other lists
authorJay Conrod <jayconrod@google.com>
Wed, 8 Jul 2020 20:20:51 +0000 (16:20 -0400)
committerJay Conrod <jayconrod@google.com>
Mon, 10 May 2021 15:53:43 +0000 (15:53 +0000)
commitdeb3403ff52b8833df6c4e2f82cbdddeb13573dd
tree232da9d044da3d5a95e09eab72d94b8d2a9ee8fe
parent82517acae866d60a9754d44d004bfa159e656c07
go/build: include files with parse errors in GoFiles and other lists

go/build.ImportDir returns a *build.Package with various lists of
files. If a file is invalid for some reason, for example, because it
has a different package name than other files, it's added to
InvalidGoFiles in addition to GoFiles, TestGoFiles, or other lists.

Previously, files with parse errors or build constraint errors were
not included in these lists, which causes problems for tools that use
'go list' since InvalidGoFiles is not printed. With this change, files
with any kind of error are added to one of the GoFiles lists.

Fixes #39986

Change-Id: Iee007b5092293eb4420c8a39ce731805fe32135f
Reviewed-on: https://go-review.googlesource.com/c/go/+/241577
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/testdata/script/list_load_err.txt
src/go/build/build.go