Skip to content

Go Modules

CloudRepo speaks the Go module proxy protocol, the one GOPROXY uses. Point Go at a CloudRepo Go repository and your builds pull every module through your organization’s own host. To set it up, see Pull Go modules through CloudRepo.

  • A Go proxy. A cache of proxy.golang.org, the Go module mirror. A Go proxy has one upstream, https://proxy.golang.org, and the admin portal sets it for you.
  • A Go group. One URL in front of up to 10 of your Go proxies. It asks them in Priority order and serves the first answer.

Coming from Artifactory or Nexus? A Go proxy is what they call a remote or proxy repository, and a Go group is what they call a virtual or group repository. See Artifactory and Nexus terms.

Not in early access:

  • Hosting your own modules. A Go repository is a proxy or a group, so you cannot publish a Go module to CloudRepo yet.
  • Public Go repositories. Every pull from a Go repository takes a repository token.
  • Scanning. CloudRepo does not scan Go modules yet.
  • What is cached. For each module version, CloudRepo fetches the .info, .mod and .zip from proxy.golang.org the first time a build asks, keeps them, and serves that copy after. The version list and @latest are passed through from proxy.golang.org.
  • Capital letters in module paths. The go command writes each capital letter as ! and the letter in lower case, so github.com/BurntSushi/toml goes out as github.com/!burnt!sushi/toml. CloudRepo serves these modules like any other.
  • +incompatible versions. A module at v2 or later that has no go.mod, such as github.com/dgrijalva/jwt-go v3.2.0+incompatible, keeps its +incompatible version.
  • Pseudo-versions. A pseudo-version names a commit, such as golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543. CloudRepo caches it like any other version.
  • Large modules. proxy.golang.org sends some large zips from Google Cloud Storage instead. CloudRepo follows it there and caches the zip, such as the 21 MB one of github.com/aws/aws-sdk-go v1.40.0.
  • The checksum database. CloudRepo does not proxy sum.golang.org. When the go command asks whether it does, CloudRepo answers 404 Not Found, so the go command checks every module with sum.golang.org itself. Keep GOSUMDB on.

Each module above was downloaded through a CloudRepo Go proxy with Go 1.26.5, checked against sum.golang.org, and downloaded again from CloudRepo’s copy. To try the same four with your own setup:

Terminal
go mod download -json \
github.com/BurntSushi/toml@v1.6.0 \
github.com/dgrijalva/jwt-go@v3.2.0+incompatible \
golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 \
github.com/aws/aws-sdk-go@v1.40.0

Each module’s result names its Sum and GoModSum: the hashes sum.golang.org holds for that version.

View as Markdown