Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's quite possible that it's just my laziness in figuring out how to do it.

All I know is that hitting 'F5' in VSCode builds the binary and runs it under the debugger.

How would I debug the equivalent of `go test` in VSCode?



I have no idea in VSCode, but with JetBrains Gogland, debugging tests is stupidly easy. Simply add the breakpoint where you want it, left click on the play button in the line of the test declaration, click debug in the contextual menu, and off you go.


too bad sometimes it doesn't resolve pointers correctly


In Go test files, there's now a codelens annotation above every Test function with "run test" and "debug test" commands. Just click "debug test" to launch a debugger against that test.

See https://twitter.com/ramyanexus/status/860190148239081472

If you want to configure F5 to launch tests instead of your main entry point, you can do that too in your launch.json file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: