Stage 1 · Lesson 5 of 10
Packages and Go modules
A Go is a folder of files that share a package name. Names that start with a capital letter are exported, meaning other packages can use them. A is a set of packages with a go.mod file at the root.
You create one with go mod init github.com/you/project. go get adds a . go mod tidy removes unused ones and fills in go.sum, which records checksums so every download can be verified.
Learn the usual layout: cmd/ holds the programs you run, and internal/ holds packages that other modules cannot import.
Common trapcreating many tiny packages up front, or packages that import each other in a circle. Start with a few packages organised by what they do, and split one only when it becomes hard to follow.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with
- CourseFreeA Tour of Go
The Go Authors · Beginner
The official interactive tour: basics, methods, interfaces, generics and concurrency
Practise
Keep handy
Also worth your time
The DNS, TCP, TLS and HTTP steps behind every request your backend will handle