I had a problem with go get
using private repository on gitlab from our company.
I lost a few minutes trying to find a solution.... and I did find one:
-
You need to get a private token at:
https://gitlab.mycompany.com/profile/account
-
Configure you git to add extra header with your private token:
$ git config --global http.extraheader "PRIVATE-TOKEN: YOUR_PRIVATE_TOKEN"
-
Configure your git to convert requests from
ssh
tohttp
:$ git config --global url."[email protected]:".insteadOf "https://gitlab.mycompany.com/"
-
Finally you can use your
go get
normally$ go get gitlab.com/company/private_repo