Go/VSCode: Cannot find definitions or run tests

Viewed 21

I'm using Go with VSCode on a macbook.

Ever since I reinstalled the OS, I haven't been able to F12 to go to the function definitions. And the options to run tests and package tests are no longer visible at the top of test files.

I've tried re-installed VSCode, the Go extension, and Go itself, none of that has worked.

How to get Go to Definition working again?

1 Answers

You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click

Source

and about unit tests you can use terminal and type

go test

or

go test -v

if I missed something please reply I would like to help.

Related