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