Using private Golang libs

alextrending

Alex Rios

Posted on December 21, 2019

Using private Golang libs

1 - Configure GIT (~/.gitconfig)

[url "ssh://git@github.com/"]
    insteadOf = https://github.com/
Enter fullscreen mode Exit fullscreen mode

2 - Add the private repository location in GOPRIVATE env var

go env -w GOPRIVATE="github.com/<org>/<project>"
Enter fullscreen mode Exit fullscreen mode

2.1 - You can add a whole organization accepting all projects with *

go env -w GOPRIVATE="github.com/<org>/*"
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
alextrending
Alex Rios

Posted on December 21, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related