How to build Go packages from private repositories
Let’s say you have a Go package on a private repository which is tagged as
and want to build an application with it:
1. Create a go.mod file with the private repository
This will be the
go.mod file of your application:
2. Edit .gitconfig file
Put following lines to your
3. Set GOPRIVATE
Then set an environment variable,
You can put above lines in the .rc files, or even in your build scripts.
Then you’ll be able to build your application with packages on private repositories :-)
Please let me know if there is a better way!