Learn Go (Golang) from Scratch

Learn Go from installation to a working web server: types, control flow, slices and maps, structs and interfaces, error handling, goroutines and channels.

7 lessonsBeginner to IntermediateFreeLive code examples

Start lesson 1 →

What you will learn

  • Write clear, idiomatic Go code
  • Model data with structs and interfaces
  • Handle errors the Go way
  • Use goroutines and build a small HTTP server

Course syllabus

  1. Introduction to Go: Install and Hello WorldLearn what the Go programming language is, why companies use it, how to install it and how to write, run…
  2. Go Variables, Types and ConstantsLearn how to declare variables in Go, its basic data types, zero values, short declarations, constants and type conversion.
  3. Go Control Flow: if, for and switchLearn Go conditionals and loops: if with init statements, the single for loop, range, switch and defer, with examples.
  4. Go Functions, Slices and MapsLearn Go functions with multiple return values, variadic functions, slices, maps and how to work with collections efficiently.
  5. Go Structs, Methods and InterfacesLearn how Go models data with structs, adds behaviour with methods and pointer receivers, and uses interfaces for flexible design.
  6. Go Error HandlingLearn idiomatic Go error handling: returning errors, wrapping with fmt.Errorf, custom errors, errors.Is and errors.As, and when to use panic.
  7. Go Concurrency and a Tiny Web ServerLearn goroutines, channels and sync.WaitGroup, then build a small HTTP server with the net/http package that returns JSON.

Other courses