Go Modules
go.dev
- Free plan
- Windows
- macOS
- Linux
- iPhone and iPad
- Android
What Go Modules is
Go Modules is the dependency system for Go projects. It groups packages that are released, versioned, and distributed together, with each module identified in a UTF-8 encoded go.mod file at the project root. The file records the module path and dependencies, while semantic versions normally follow a major, minor, and patch pattern. Minimal version selection keeps chosen versions consistent for reproducible builds, and commands that load the module graph can update go.mod when needed. A go.work file lets one workspace use multiple modules. Dependencies can come from version-control repositories or proxies configured through GOPROXY, including private sources controlled with settings such as GOPRIVATE and GONOPROXY. Download hashes are checked against go.sum and a public checksum database. Go Modules support dependency resolution, lockfiles, workspaces, private registry authentication, and offline installation. The system is free and part of the BSD-licensed open-source Go project.
Who it suits
Go developers and teams managing dependencies across one or multiple modules. It suits projects needing reproducible builds, private dependencies, proxy control, or offline installation.
Good to know, and what to watch
- Semantic versioning for modules
- Reproducible builds through minimal version selection
- Workspace support with go.work
- Private module configuration
- Checksum verification through go.sum
- Toolchain rejects modules requiring newer Go versions
- Configuration is needed for private module sources
The verdict
Go Modules provides Go projects with structured dependency metadata, version selection, workspaces, and verification. Its private-source and proxy settings also support controlled dependency workflows.
What the maker publishes
- Automatic updates
- Commands that load the module graph automatically update go.mod when needed. source
- Checksum database
- The public checksum database provides a global source of go.sum lines to verify module contents. source
- Compatibility requirement
- Since Go 1.21, a toolchain refuses to use a module that declares a newer Go version than the toolchain supports. source
- Dependency file
- Each module is defined by a UTF-8 encoded go.mod file in its root directory. source
- Dependency metadata
- A module is identified by its module path, declared in a go.mod file together with information about its dependencies. source
- Dependency resolution
- Yes source
- Dependency sources
- Modules may be downloaded directly from version control repositories or from module proxy servers. source
- Free plan
- Yes source
- Integrity verification
- Downloaded module hashes are checked against go.sum and mismatches produce a security error without installing the file. source
- License
- Go is an open source project distributed under a BSD-style license. source
- Lockfile support
- Yes source
- Module model
- A module is a collection of packages released, versioned, and distributed together. source
- Module proxy
- The go command defaults to downloading modules from the public Go module mirror for Go 1.13 and later module users. source
- Module structure
- A module is a collection of packages that are released, versioned, and distributed together. source
- Offline installation
- Yes source
- Origin
- Go was created at Google in 2007 and released publicly in November 2009. source
- Package formats
- Go modules,module ZIP files source
- Private dependencies
- The Go Modules reference documents environment variables including GOPRIVATE and GONOPROXY for controlling module lookup behavior. source
- Private modules
- The go command can download and build modules from private sources with configuration such as GOPRIVATE and GOPROXY. source
- Private registry auth
- Yes source
- Project and license
- Go is an open source project developed by a team at Google and community contributors, and is distributed under a BSD-style license. source
- Proxy configuration
- The go command's GOPROXY setting can specify proxy URLs or the keywords direct or off. source
- Purpose
- Go Modules manage dependencies for Go projects. source
- Purpose
- Go modules are how Go manages dependencies. source
Checked against the maker's pages on 2 Oct 2026.