Backend development

Stage 1 · Lesson 5 of 10

Packages and Go modules

Your language and how HTTP works

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

  • CourseFree
    A Tour of Go

    The Go Authors · Beginner

    The official interactive tour: basics, methods, interfaces, generics and concurrency

Practise

  • Your language track: small exercises with free mentor feedback on idiomatic code

Keep handy

  • Short runnable examples to look up while you write: errors, JSON, goroutines, testing

  • Read the HTTP overview, methods, headers and status code pages until they feel obvious

Also worth your time

Mark this stage as not done?