cmd/go: go list -e -json with syntax error behaves differently in test and non-test files #28491
Labels
FrozenDueToAge
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
The context of this problem is:
gocode
, was failing to offer a completion in a_test.go
file but succeeding in a regular.go
file with the same contentgo/packages
go list
level; hence this issue and reproThe following behaves as expected and lists the
main
package, despite the syntax error inmain.go
:However, if we create the same syntax error in a test file (continuing the example above):
the test package,
example.com/hello.test
, fails to list.What did you expect to see?
Given the successful list of the
main
package despite the syntax error, I think it makes sense for theexample.com/hello.test
test package to list successfully too.What did you see instead?
An error in the list of
example.com/hello.test
The text was updated successfully, but these errors were encountered: