go.mod
🔧 ConfigText-based

go.mod File — Go Module File

text/plain

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

GO.MOD

Drop a go.mod file here or click to choose

Or drop any file to identify its extension

Expected MIME type:text/plain

Quick Facts

Extensiongo.mod
Full NameGo Module File
MIME Typetext/plain
CategoryConfig
TypeText-based (human-readable)
Typical Size100 B – 5 KB
First Appeared2018

What Is a go.mod File?

go.mod is the module definition file for Go projects, introduced with Go modules in Go 1.11 (2018) as the official dependency management solution. The file declares the module's path (module github.com/user/project), the minimum Go version required (go 1.21), and direct dependencies with their versions (require directives). go.mod also supports replace directives (for local development forks or alternative module paths), exclude directives (to skip specific versions with known issues), and retract directives (for marking versions that shouldn't be used). Go modules use semantic versioning and minimum version selection (MVS) — instead of resolving to the newest compatible version, Go selects the minimum version that satisfies all requirements, ensuring reproducible builds across different environments. The companion go.sum file contains cryptographic hashes of all dependencies for integrity verification. The Go module system is notable for its simplicity compared to other package managers — there's no separate install step, no central lock file, and the toolchain handles everything through standard go commands (go get, go mod tidy, go mod vendor). Module proxies (proxy.golang.org) and checksum databases (sum.golang.org) provide reliability and security.

How to Open go.mod Files

VS Code
GoLand
vim
any text editor
go (toolchain)

Related File Extensions

More Config File Extensions

Other config formats you might encounter

Browse File Extensions by Category

Explore our reference of 259 file extensions with details, programs, and related formats.