I try to start using Go in VSCode. I\'ve installed Go as well as Git and created a project in Code, containing a single .go
file.
When I type something, VSC
You might be running an old version of Go. Try removing your version and install the latest version from Go's site.
Solution: Just Exit the app & Restart the application as Admin (Run as Administrator). It'll work fine & every module/dependency will be installed Successfully.
It looks like it's complaining due to C:\Users\user\go\src\golang.org\x\tools
being not a git repo, so it can't update whatever is in it.
Assuming you didn't put your own code in that dir, try removing it and then running again.
If you look at the docs for the Go plugin, and scroll all the way to the bottom, it shows the commands to run if you want to manually install/upgrade the stuff the plugin needs.
Specifically, taken from their github repo, you can just run this from a cmd.exe prompt.
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/zmb3/gogetdoc
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/cweill/gotests/...
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/fatih/gomodifytags