Golang from Scratch: Learn Go Step by Step#

Go (also called Golang) is a small, fast language for servers, command-line tools and anything that needs to do many things at once. This course follows the 40 Days of Go syllabus from the syedjaferk/40_days_of_go_lang repository: start with the basics, build file and command-line tools, then web APIs and a database, and finish with goroutines, channels and tests.

Note

Why learn Go, in one line? You write simple code, the compiler checks it hard, and you ship one fast program with nothing else to install. Docker, Kubernetes and Terraform are all written in Go.

The 18 sessions in four phases Foundations, then files and command-line tools, then web APIs and databases, then concurrency and testing. 1 · Foundations Hello & basics Functions Arrays & slices Maps Structs & JSON Pointers Errors 2 · Files & CLI Files Args & flags Logging & config 3 · Web & data HTTP Todo API Database 4 · Concurrency Goroutines WaitGroup Mutex Channels Testing
Foundations, then files and command-line tools, then web APIs and databases, then concurrency and testing.

How each session works#

  1. Watch the class (where a recording exists): the matching video from the Golang from Scratch playlist sits at the top of the session.

  2. The big idea: the topic in plain words, with an everyday example.

  3. A picture: a diagram of the idea.

  4. Runnable code: every program is run for real, and the output you see is what it printed.

  5. Common mistakes: what trips beginners up.

  6. Hands-on exercises: try first, then reveal the solution (every solution was run too).

  7. Practice: a quiz and a flashcard deck for the session.

Tip

New here? Start with Setup, then go in order. Type the examples yourself rather than copying; your fingers learn the syntax faster than your eyes do.

Important

Read the compiler’s errors. Go’s messages are short and exact (declared and not used, missing return). Fix the first one, run again, and repeat. That loop is the fastest way to learn.