Go module
A tree of Go packages that is versioned and released together, described by a go.mod file at its root.
In more detail
A module is the unit of dependency in Go: you depend on modules, and each has one path and one version at a time. Its go.mod file records the module path, the language version and the modules it needs. Nothing is installed globally, so two projects on one machine can use different versions of the same dependency.
Example
go mod init course.local/probeRelated terms
- go.mod — The text file at the root of a Go module that records its module path, the Go version it needs and the other modules it depends on.
- module path — The name a Go module declares in its go.mod file, which is also the prefix of every import path inside it.
- Go package — A folder of Go source files that are compiled together and share one package name, which other code imports as a unit.
- dependency — Anything a program needs in order to work, such as a library, a tool or another service.
Taught in
- Installing the Go Toolchain — Concurrent Systems Programming with Go
- Go Workspaces and Modules — Concurrent Systems Programming with Go
- Your First Program and go run — Concurrent Systems Programming with Go
- Variables, Typing, and Zero Values — Concurrent Systems Programming with Go