-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Jay Conrod
committed
Mar 8, 2019
1 parent
1ab9f68
commit f1d5ce0
Showing
5 changed files
with
253 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.