SSH issues with Golang go get

Hey all,

new here, and as well to circleci. I managed to set everything up with my current repo having three jobs. 2 of which use go get which is how golang grabs dependencies. The dependencies I am grabbing are private, so I have set up the proper ssh keys. One of the jobs uses docker for integration testing and is currently failing with go get, but the other is not which confirms that ssh was setup properly in the config file. My assumption is circleci is doing something with the ssh keys that I am not capturing. I am bind mounting ~/.ssh to /root/.ssh in Docker, so I have no idea why the docker job is failing the go get.

Here is the error: Are you sure you want to continue connecting (yes/no)? The authenticity of host 'github.com (192.30.253.112)' can't be established.

Normally if that question is asked in non-interactive mode, it will default to “no” and the command will fail. I tend to deal with this by doing the SSH operation manually in a CircleCI SSH session, and then copying the change to the known_hosts file to the build.

The SSH session is also a good idea to check your keys are working.