Problems using `go get`

macOS 10.12.5 Sierra
Golang 1.8.3

Hello, my system has suddenly developed a problem whereby I do not appear t be able to use the go get command. A typical session goes like this…

 ~/C/g/s/  go get
# cd .; git clone /Users/carlca/Code/go/src/
Cloning into '/Users/carlca/Code/go/src/'...
Warning: Permanently added the RSA host key for IP address '' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
package exit status 128

I have tried to repair my git credentials using this page but it doesn’t seem to have made any difference.

Can anyone help?


Git is using ssh despite apparently being told to use https. That then fails because you don’t have the correct/appropriate/whatever ssh keys available.

You might have a config that says to use ssh instead of https for GitHub - look for insteadOf in the Git config, or google that for more info.

1 Like

Check that your SSH credentials are correctly loaded by the macOS authentication agent, using the terminal command ssh-add -l.

If not, add your credentials. See ssh-add -? and man ssh-add for options.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.