I've been trying to learn Golang backend development and have been following this Youtube guide
https://www.youtube.com/playlist?list=PLy_6D98if3ULEtXtNSY_2qN21VCKgoQAE
But when learning about writing tests i've found that my vscode doesn't display the 'run tests | debug tests' Codelens. I'm running my vscode from my WSL2 Ubuntu using the 'code .' command.
I was also wondering if the command go test ./db/sqlc/ -run TestCreateAccoun offers that same functionality as this codelens?
The steps that i've tried already have been to
- disable and re-enable the 'Editor: Code Lens' setting in preferences
- restart my WSL
- reinstall go extension
- Double check documentation, I follow the file naming convention ending in _test.go and my function starts with Test docs
- followed debugging steps described by others in this post but nothing worked
I was wondering if anyone knew further debug steps - i'm willing to give necessary output.
To answer your second question,
go test ./db/sqlc/ -run TestCreateAccountis indeed equivalent to therun testbutton in VS Code. Thedebug testbutton starts the debugger.Regarding your initial question, are the
Go > Test Explorer: EnableandGo > Tasks: Provide Defaultcheckmarks set? You can find these through Settings > Settings > User Settings > search for "go test enable" as shown in attached image.