vscode solve the problem go mod code completion

After the upgrade go to version 1.13, opened the go mod module, leading to auto-complete function vscode difficult to use, found a lot of information in the google, after opening go mod, does not recommend the use of tools go, it is recommended to use Go Language Server, then find information, search vscode entrance open Go Language Server, find the open method.

Open the settings, search for "  go.useLanguageServe", and checked, by default, Go extensions will prompt you to install gopls

 

If the installation fails, the installation can be used in the following manner

go get golang.org/x/tools/gopls@latest

After the installation is complete restart vscode, testing whether the auto-complete recovery.

Open go mod method:

 go env -w GO111MODULE=on

 

 

Published 66 original articles · won praise 8 · Views 140,000 +

Guess you like

Origin blog.csdn.net/gnufre/article/details/104281921