Go

A small, fast, compiled language for servers, command-line tools and cloud services.

Go (Golang) is a statically typed, compiled language created at Google, with a small feature set that keeps code easy to read. It has built-in support for concurrency and compiles to a single binary that is easy to deploy.

  • Intermediate
  • 12 lessons
Not started yet
Start lesson 1

Lessons

  1. Hello, World!Write and run your first Go program. It shows the three pieces every Go file has: a package declaration, imports and functions.
  2. Variables & TypesLearn how to declare variables and constants and which basic types Go provides. Go checks types at compile time but can often infer them for you.
  3. Control FlowLearn if, switch and for. Go has only one loop keyword, for, which covers counting loops, while-style loops and loops over collections.
  4. Functions & Multiple ReturnsLearn how to write functions, including ones that return more than one value. Returning a result together with an error is how Go handles failures.
  5. Slices & MapsLearn Go's two main collection types: slices, which are resizable lists, and maps, which store key-value pairs. Most Go programs use both.
  6. Structs & InterfacesLearn how Go groups data with structs, attaches behavior with methods, and describes shared behavior with interfaces. Go uses composition instead of classes and inheritance.
  7. Mini Project: HTTP ServerBuild a small web server using only Go's standard library. It brings together functions, structs, maps and error handling in one working program.
  8. Goroutines & ChannelsLearn how to run work concurrently with goroutines and pass data between them with channels. Goroutines are cheap, so Go programs often start thousands of them.
  9. Errors, Panics & TestingLearn how Go reports errors as ordinary return values, when panic is appropriate, and how to write tests with the built-in testing package.
  10. Packages, Modules & the Standard LibraryLearn how Go code is organized into packages and modules, and how to use the standard library. A single go.mod file and the go command handle building and dependencies.
  11. GenericsLearn how to write functions and types that work with many types using type parameters and constraints, available since Go 1.18.
  12. Go CheatsheetSyntax, slices, maps, errors, and goroutines on one page.

Install it on your own computer

Go has one official installer per platform, and it includes everything you need: the compiler, formatter, test runner and module tools.

Bash
# Download the Windows installer from go.dev/dl
# Run the .msi — it handles PATH setup automatically

# Or via winget:
winget install GoLang.Go

# Verify:
go version

What people build with Go

Learn the basics first, then pick up these tools when a project needs them.

Practical uses

  • Build cloud services and network servers
  • Create fast single-binary command-line tools
  • Develop infrastructure and observability systems
  • Run concurrent data-processing pipelines

Projects to try

  1. Concurrent URL checker
  2. Static file server
  3. Container metrics agent
  4. Distributed key-value store

Common tools and packages

GinChiCobraGORMsqlcTestifyZapOpenTelemetry

Well-known software

DockerKubernetesTerraformPrometheusGrafanaHugo