Install the Go toolchain, initialise a module, and write, run and build your very first Go program with confidence. You will learn the everyday go commands, how modules replaced GOPATH, sensible project layout, and where to reach in the standard library.
Watch the free preview
Installing Go and verifying your toolchain — free to watch, no account needed.
What you'll learn
- Set up Go and run your first program end to end
- Explain how Go modules replaced GOPATH and initialise one with go mod init
- Use the core go tool commands — run, build, fmt and vet — in daily work
- Lay out a small Go project with package main and func main
- Navigate the standard library to find the package you need
Syllabus
Installing Go and Your First Program
Installing Go and verifying your toolchainFree preview
package main, func main, and your first program
The go Tool in Everyday Use
Running and building with go run and go build
Formatting and checking code with go fmt and go vet
Modules and Project Layout
Modules and go mod init — GOPATH versus modules
Structuring a small Go project
Using the Standard Library
A tour of the standard library
Putting it together — a small command-line program
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10