-
Notifications
You must be signed in to change notification settings - Fork 796
When using go1.24 or later, the Go: Test command no longer displays compile errors #3744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CC @h9jiang I'm confused, as I get build errors on stderr both 1.23 and 1.24, so I'm not sure why the Go version would matter here. |
@findleyr Go 1.24 changes how func Test(t *testing.T) { 1 }
Presumably, the existing code is detecting output that's written to stderr (and probably the return code) and using that to detect and display failures. And now, the build error output has been merged into the JSON event stream with new |
Thanks @firelizzard18 and @shibayu36 for investigating. @h9jiang this is a semi-urgent bug to fix. Putting in the next milestone. It should hopefully be easy to address. |
I believe the relevant code is in - if (m.Action !== 'output' || !m.Output) {
+ if (!(m.Action === 'output' || m.Action === 'build-output') || !m.Output) {
return;
} |
I think the "go.testFlags": [
"-v",
"-count=1",
"-timeout=120s"
] As a result, the -json output might be enabled by and that could be why By the way, when I removed -v from the settings, the compile errors started showing up again. |
That does seem like the answer and I think I also have -v set. Thanks for pointing that out, I missed it when I looked at that code. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
After upgrading to Go 1.24, running the Go: Test command (e.g. Go: Test File) no longer displays compile errors in the Output.
It is probably because in go1.24, go test -json now returns the build output in JSON as well.
https://tip.golang.org/doc/go1.24
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
Cause a compile error

When running Go: Test File using go1.24

When running Go: Test File using go1.23
The text was updated successfully, but these errors were encountered: