Manually restart GoCode

gocode close
gocode -s
Copy the code

Update gocode

go get -u -v github.com/stamblerre/gocode
Copy the code

Setting. Json in VsCode requires inferGopath

"go.inferGopath": true.Copy the code

Other situations

go modconflict

With the Go mod, two environment variables GOPROXY and GO111MODULE are added, and inferGopath is disabled.

Change the GO111MODULE environment variable to OFF, and you’ll have an intelligent hint for your code. Change this environment variable to ON each time you need to download a dependency package.