Trying to get Go modules to play ball with private repos?
2020-07-08
go modules are wonderful. All go code should use
them.
It can still be a bit tricky getting private repos to work with
go mod. Maybe these tips help… ¯\_(ツ)_/¯
Set up
SSHkeys with your version control vendorAdd the following to your
~/.gitconfig:[url "ssh://git@github.com/"] insteadOf = https://github.com/ [url "ssh://git@gitlab.com/"] insteadOf = https://gitlab.com/ [url "ssh://git@bitbucket.org/"] insteadOf = https://bitbucket.org/Add the offending repo as a private repo:
go env -w GOPRIVATE=gitlab.com/you/your-project,github.com/someone/their-project