← All paths
GoBeginner

Go — Basics

Learn Go (Golang): variables, functions, slices and maps. Code compiled and run on the server.

10 chapters40 lessons22 challenges

Course curriculum

Chapter 1: Variables and types

  • ▸What is Go
  • ▸Variables
  • ▸The basic types
  • ▸Constants and zero values

Chapter 2: Control flow

  • ▸if and for
  • ▸switch
  • ▸for as while
  • ▸if with init statement

Chapter 3: Functions

  • ▸Defining functions
  • ▸Multiple returns
  • ▸Errors: (value, err)
  • ▸defer and closures

Chapter 4: Slices and maps

  • ▸Slices
  • ▸Maps
  • ▸make, capacity and sub-slices
  • ▸Structs: your own types

Chapter 5: Structs and methods

  • ▸Defining a struct
  • ▸Methods on a struct
  • ▸Value vs pointer receivers
  • ▸Composition (embedding)

Chapter 6: Interfaces

  • ▸What an interface is
  • ▸Polymorphism with interfaces
  • ▸Empty interface and type switch
  • ▸Standard library interfaces

Chapter 7: Error handling

  • ▸Errors are values
  • ▸Creating errors
  • ▸Wrapping and errors.Is/As
  • ▸panic and recover

Chapter 8: Goroutines and channels

  • ▸Goroutines
  • ▸Channels
  • ▸Collecting results
  • ▸Buffered channels and close

Chapter 9: Concurrency: synchronization

  • ▸sync.WaitGroup
  • ▸sync.Mutex
  • ▸select
  • ▸Patterns and best practices

Chapter 10: Advanced Go: stdlib and beyond

  • ▸Packages and modules
  • ▸The standard library
  • ▸Testing in Go
  • ▸Generics (Go 1.18+)

Ready to level up?

Create a free account and start now: earn XP on every challenge and climb the leaderboard.

Go — Basics — LevelUpCode