Go course

The Go gopher, mascot of the Go language, speaking through a megaphone (pencil drawing)

A small, fast language for backends, tools and network services. From variables to generics, then two small projects.

17 chapters, 97 lessons

Variables

5 lessons

The Go gopher wearing a miner's helmet with its lamp on (pencil drawing)
  1. Hello, Gopher!Output exerciseNot started
  2. Declaring VariablesOutput exerciseNot started
  3. Short Variable Declaration :=Test exerciseNot started
  4. Basic Data TypesCode exampleNot started
  5. Quiz: VariablesQuizNot started

Constants and Formatting

6 lessons

  1. ConstantsTest exerciseNot started
  2. Constant Blocks and Untyped ConstantsCode exampleNot started
  3. Formatting Output with fmt.PrintfOutput exerciseNot started
  4. Building Strings with fmt.SprintfTest exerciseNot started
  5. Column Width and PaddingTest exerciseNot started
  6. Quiz: Constants and FormattingQuizNot started

Conditionals

6 lessons

  1. Branching with if and elseTest exerciseNot started
  2. Logical OperatorsTest exerciseNot started
  3. if with an Init StatementTest exerciseNot started
  4. switchTest exerciseNot started
  5. Tagless switch and fallthroughTest exerciseNot started
  6. Quiz: ConditionalsQuizNot started

Functions

6 lessons

  1. Parameters and Return ValuesTest exerciseNot started
  2. Multiple Return ValuesTest exerciseNot started
  3. Early Returns and Guard ClausesTest exerciseNot started
  4. Functions as ValuesTest exerciseNot started
  5. deferOutput exerciseNot started
  6. Quiz: FunctionsQuizNot started

Structs

6 lessons

  1. Defining StructsTest exerciseNot started
  2. Nested StructsTest exerciseNot started
  3. Anonymous StructsCode exampleNot started
  4. Embedded StructsTest exerciseNot started
  5. Methods on StructsTest exerciseNot started
  6. Quiz: StructsQuizNot started

Interfaces

6 lessons

  1. Getting to Know InterfacesTest exerciseNot started
  2. Satisfying Several InterfacesTest exerciseNot started
  3. Type AssertionsTest exerciseNot started
  4. Type Switches and anyTest exerciseNot started
  5. The Stringer InterfaceOutput exerciseNot started
  6. Quiz: InterfacesQuizNot started

Errors

5 lessons

  1. The error InterfaceTest exerciseNot started
  2. fmt.Errorf and Wrapping ErrorsTest exerciseNot started
  3. Custom Error TypesTest exerciseNot started
  4. Panic vs ErrorCode exampleNot started
  5. Quiz: ErrorsQuizNot started

Loops

6 lessons

The Go gopher swimming in an animal-shaped rubber ring (pencil drawing)
  1. The for LoopTest exerciseNot started
  2. for as whileTest exerciseNot started
  3. Infinite Loops, break, and continueTest exerciseNot started
  4. range over IntegersOutput exerciseNot started
  5. Looping over Strings and RunesTest exerciseNot started
  6. Quiz: LoopsQuizNot started

Slices

6 lessons

  1. Arrays and SlicesTest exerciseNot started
  2. make, len, cap, and appendTest exerciseNot started
  3. Slicing: Cutting a SliceTest exerciseNot started
  4. Variadic Functions and the ... OperatorTest exerciseNot started
  5. 2D Slices and the slices PackageTest exerciseNot started
  6. Quiz: SlicesQuizNot started

Maps

6 lessons

  1. Getting to Know MapsTest exerciseNot started
  2. Checking Whether a Key Exists: Comma-okTest exerciseNot started
  3. Iterating over Maps and Key OrderOutput exerciseNot started
  4. Counting FrequenciesTest exerciseNot started
  5. Nested Maps and Maps of StructsTest exerciseNot started
  6. Quiz: MapsQuizNot started

Pointers

6 lessons

  1. Address and Dereference: & and *Test exerciseNot started
  2. Pass by Value vs Pass by PointerOutput exerciseNot started
  3. Pointer Receivers vs Value ReceiversTest exerciseNot started
  4. Nil PointersTest exerciseNot started
  5. When Should You Use Pointers?Code exampleNot started
  6. Quiz: PointersQuizNot started

Packages and Modules

6 lessons

Two Go gophers building a small robot with a wrench and a hammer (pencil drawing)
  1. Packages and ImportsCode exampleNot started
  2. Exported vs UnexportedTest exerciseNot started
  3. Modules and the go CommandReadingNot started
  4. Standard Library: strings and strconvTest exerciseNot started
  5. Standard Library: math and sortTest exerciseNot started
  6. Quiz: Packages and ModulesQuizNot started

Channels

6 lessons

  1. Goroutines and ChannelsTest exerciseNot started
  2. Buffered ChannelsTest exerciseNot started
  3. Close, Range, and Channel DirectionTest exerciseNot started
  4. SelectTest exerciseNot started
  5. WaitGroup and DeadlockTest exerciseNot started
  6. Quiz: ChannelsQuizNot started

Mutexes

6 lessons

  1. Race ConditionsCode exampleNot started
  2. sync.Mutex: Lock and UnlockTest exerciseNot started
  3. Protecting Structs with a MutexTest exerciseNot started
  4. sync.RWMutex: Many Readers, One WriterTest exerciseNot started
  5. sync.Once and Choosing Between a Mutex and a ChannelTest exerciseNot started
  6. Quiz: MutexesQuizNot started

Generics

6 lessons

  1. Generic FunctionsTest exerciseNot started
  2. The comparable ConstraintTest exerciseNot started
  3. Custom Constraints and cmp.OrderedTest exerciseNot started
  4. Generic TypesTest exerciseNot started
  5. When NOT to Use GenericsCode exampleNot started
  6. Quiz: GenericsQuizNot started

Enums

5 lessons

  1. Enums with const and iotaOutput exerciseNot started
  2. A String Method for EnumsTest exerciseNot started
  3. Validating Enum ValuesTest exerciseNot started
  4. Switching on EnumsTest exerciseNot started
  5. Quiz: EnumsQuizNot started

Projects and Final Review

4 lessons

The Go gopher in flying goggles piloting a biplane (line drawing)
  1. Go ProverbsQuizNot started
  2. Project: Mini Bank LedgerTest exerciseNot started
  3. Project: Warehouse InventoryTest exerciseNot started
  4. Final Quiz: Reviewing Every ChapterQuizNot started