Go Repositories
Go Repositories
Go modules are the standard dependency mechanism for Go applications. Go utilizes a decentralized dependency model where the source control system (VCS) is often the primary source of truth.
Go utilizes two separate components to mirror module content and checksum data. The go.mod file defines the module identity and direct dependencies. The go.sum file stores cryptographic hashes to ensure module versions remain unchanged. Sonatype Nexus Repository integrates with both the infrastructure components.
| Component | Public Default | Purpose |
|---|---|---|
| Module Proxy | proxy.golang.org | Mirror and serve module source code (.zip, .mod, .info). |
| Checksum Database | sum.golang.org | Serve SHA-256 hashes of module proxy content for integrity validation. |
Sonatype Nexus Repository supports the Go module proxy protocol so you can centralize access to public modules, host internal modules, and expose a single endpoint for Go dependency resolution.
Go repositories are available in both Pro and Community Edition. Nexus supports authenticated access and can also be used with anonymous access when enabled. See the Go Modules Reference for background on the Go module ecosystem.
Getting Started with Go in Nexus
Explore the following topics to know how to configure and use Go with Nexus.
Nexus for Go
Proxy repository: Centralize access to public Go modules through Nexus proxy repositories. Proxy repositories cache content from upstream sources such as
https://proxy.golang.org.Hosted repository: Store internal Go modules in Nexus and publish module
ZIPfiles to a hosted repository. Go hosted repository is available from 3.93 in self-hosted deployments.Group repository: Combine multiple Go repositories, such as hosted and proxy repositories, behind a single URL for client configuration.
Basic support (core module proxy protocol) for Go 1.11+
Complete support for Go 1.17+ and Go 1.21+
Supports authenticated and anonymous access