import path
The string that identifies a package in an import line: the module path followed by the folder inside the module.
In more detail
If the module is course.local/probe and the package lives in check/, its import path is course.local/probe/check. Standard library packages have short bare paths such as os or net/http. Renaming a folder changes the import path; there is no separate registry to update.
Example
import "course.local/probe/check"Related terms
- module path — The name a Go module declares in its go.mod file, which is also the prefix of every import path inside it.
- import declaration — The line near the top of a Go file that names the packages the file uses, such as import "fmt".
- Go package — A folder of Go source files that are compiled together and share one package name, which other code imports as a unit.
Taught in
- Installing the Go Toolchain — Concurrent Systems Programming with Go
- Go Workspaces and Modules — Concurrent Systems Programming with Go