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
sshtohttp:$ git config --global url."[email protected]:".insteadOf "https://gitlab.mycompany.com/" -
Finally you can use your
go getnormally$ go get gitlab.com/company/private_repo
Awesome! Works like a charm! 👍