diff options
| author | Jay Conrod <jayconrod@google.com> | 2019-02-13 18:35:19 -0500 |
|---|---|---|
| committer | Jay Conrod <jayconrod@google.com> | 2019-03-08 20:22:16 +0000 |
| commit | f1d5ce0185fe184c016016d55f1718778b799f6d (patch) | |
| tree | d2a8b9cdcdbc83b183301e4ad377c7ce3df1d4b5 /src/syscall/exec_linux.go | |
| parent | 1ab9f6837d6da80dad41657a913e47fa13a4fee8 (diff) | |
| download | go-f1d5ce0185fe184c016016d55f1718778b799f6d.tar.xz | |
cmd/go: make go list error behavior consistent in tests
"go list -test" constructs a package graph, then creates test packages
for the target. If it encounters an error (for example, a syntax error
in a test file or a test function with the wrong signature), it
reports the error and exits without printing the test packages or
their dependencies, even if the -e flag is given. This is a problem
for tools that operate on test files while users are editing them. For
example, autocomplete may not work while the user is typing.
With this change, a new function, load.TestPackagesAndErrors replaces
TestPackagesFor. The new function attaches errors to the returned test
packages instead of returning immediately. "go list -test" calls this
when the -e flag is set. TestPackagesFor now returns the same error as
before, but it returns non-nil packages so that "go list -test"
without -e can print partial results.
Fixes #28491
Change-Id: I141765c4574eae424d872eb9bf7dd63fdfb85efb
Reviewed-on: https://go-review.googlesource.com/c/go/+/164357
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/syscall/exec_linux.go')
0 files changed, 0 insertions, 0 deletions
