Path from .git/config in origin tag something like https://source.developers.google.com/p/PROJECT/r/REPO
Set the env var like this:
go env -w GOPRIVATE=source.developers.google.com/p/<PROJECT>/r/\*
Then, go get
will work, note .git
extension required to work directly over git, this then uses the gcloud
credential helper configured in the .git/config
inside this repo,
go get source.developers.google.com/p/<PROJECT>/r/<MODULE>.git
Init the package with a command like:
go mod init source.developers.google.com/p/<PROJECT>/r/<REPO>.git
You will have to use .git
in your import, too:
package main
import (
// testing a private module here
"source.developers.google.com/p/PROJECT/r/MODULE.git"
)