News for hackers. Stuff that matters.
Re:Porting 4.5K lines of C to Go by leastangle on Friday August 04, 2017 @07:48PM (#14933313)
> As far as I can tell you can’t step through tests in the debugger

Maybe I am missing something, but that is not correct. You can debug tests the same way as you debug any other code. Even works with the mentioned/used Go extension for VS Code.

Re:Porting 4.5K lines of C to Go by kjksf on Friday August 04, 2017 @08:00PM (#14933370)
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?

Re:Porting 4.5K lines of C to Go by devuo on Friday August 04, 2017 @08:19PM (#14933460)
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.
Re:Porting 4.5K lines of C to Go by ice109 on Monday August 07, 2017 @06:45AM (#14946534)
too bad sometimes it doesn't resolve pointers correctly
Re:Porting 4.5K lines of C to Go by lukehoban on Saturday August 05, 2017 @01:18AM (#14934345)
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.