I am using VSCode and vscode-go to develop the Go application,but, sometime, I got this error, and can't jump to the code definination
How can I get past this error message and get back all gopls features?
I am using VSCode and vscode-go to develop the Go application,but, sometime, I got this error, and can't jump to the code definination
How can I get past this error message and get back all gopls features?
As explained in golang/vscode-go issue 1229:
The error message indicates the go.mod file is incomplete and needs update.
Check the "
PROBLEMS" view (Ctrl+Shift+P> "Problems: Focus On Problems View" ), find the error-level problem (probably in thego.modfile), and either choose the Quick Fix or check the light bulb.Or, simply open the
go.modfile and run 'go mod tidy' using the code lens at the top of the file.
Obviously, make sure you are using the latest versions (of Go, VSCode and vscode-go, as well as gopls)