Fixing VS Code Go Tools Download Error

I ran in to an issue while setting up my Go environment on Ubuntu. Using VS Code I was installing the go tools to round out the set up and I ran in to an issue where I was getting permission denied errors on all the libraries hosted on github

Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/cmd/gopkgs FAILED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru SUCCEEDED

gocode:
Error: Command failed: /usr/local/go/bin/go get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
# cd /home/kashif/go/src/github.com/mdempsky/gocode; git pull --ff-only
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Turns out the issue was that my gitconfig was using an insteadOf override to use ssh always instead of https for Github, Gitlabs and Bitbucket. The simple solution was to comment out that portion in the gitcofig run the tools again from VS Code to get everything resolved and get going ;)

Comments

comments powered by Disqus