Hi,
Make sure you've properly chowned those directories and files. Keep in mind that you have to either run those commands you've mentioned as the "go" user, or establish those files in that .ssh folder and then chown them with "go:go". If you're running inside a docker container, as I believe you are, it's pretty easy to set up this process as an entry-point script. I also believe you'll always have to chown that .ssh directory so that the container go user can access them. I believe it's also pretty safe to pre-populate your git servers public ssh host keys and simply cat them into the known_hosts file. This way you don't have to accept them and these will rarely change. I've already got a working solution in place, so I'll provide some highlights here, since that's all I can do.
* gather your git servers public ssh keys with command "ssh-keyscan -p 22 [host | addrlist namelist] ...". Make sure you use any git server aliases here.
* the go server home can be figured out programatically with this command: GO_HOME=$( getent passwd "go" | cut -d: -f6 )
* create folder ${GO_HOME}/.ssh with chmod 700 and chown go:go
* generate a pair of keys if they don't already exist: ssh-keygen -q -t rsa -C "gocd-server" -N '' -f "$GO_ID_RSA_FILE"
* add your pub key to gitlab
* cat your git servers pub ssh keys into ${GO_HOME}/.ssh/known_hosts, chmod 0644 the file
* chown the entire /var/go, or just /var/go/.ssh if you prefer
All these steps should work with the .ssh folder bind-mounted.
Hope you get something working soon.
Jay