AdamDevOps
AdamDevOps

Reputation: 11

(WSL2 VSCode) Go CodeLens not showing run test | debug test

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.

code and proj structure

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

I was wondering if anyone knew further debug steps - i'm willing to give necessary output.

Upvotes: 1

Views: 444

Answers (1)

Peter Verschuure
Peter Verschuure

Reputation: 17

To answer your second question, go test ./db/sqlc/ -run TestCreateAccount is indeed equivalent to the run test button in VS Code. The debug test button starts the debugger.

Regarding your initial question, are the Go > Test Explorer: Enable and Go > Tasks: Provide Default checkmarks set? You can find these through Settings > Settings > User Settings > search for "go test enable" as shown in attached image. enter image description here

Upvotes: 0

Related Questions