Set the GOPRIVATE environment variable to your repository domain to bypass the public proxy and fetch private Go modules directly from Git.
Tell the Go toolchain to skip proxy checks for your private repository by setting the GOPRIVATE environment variable to the repository's domain pattern.
export GOPRIVATE="github.com/your-org/*"
go get github.com/your-org/private-repo
This ensures the go command fetches the module directly from Git instead of failing when the public proxy cannot access it.
The Go module system tries to download code from a public server first, which fails for private repositories. Setting GOPRIVATE tells Go to skip that public server for specific domains and go straight to your private Git host. It is like telling a delivery driver to skip the main sorting center and go directly to your private warehouse.