Go Intermediate

15 lessons

Master Go concurrency, advanced language features, and performance optimization. Learn goroutines, channels, sync primitives, context, generics, reflection, and profiling with real-world examples.

Go Intermediate

what you'll learn

  • Goroutines and Go's concurrency model — how the scheduler actually works
  • Channels, select statements, and common concurrency patterns
  • sync primitives — Mutex, WaitGroup, Once, and when to use each
  • Context propagation for cancellation, timeouts, and request-scoped values
  • Generics — type parameters, constraints, and practical use cases
  • Profiling and benchmarking — pprof, trace, and optimizing hot paths

Concurrency

The Go Concurrency Model

Understand Go's concurrency philosophy, goroutines, the GMP scheduler, and how Go achieves lightweight concurrency.

Channels

Channels are Go's primary mechanism for communication between goroutines. Learn buffered and unbuffered channels, channel directions, and common patterns.

Select Statement

The select statement lets you wait on multiple channel operations simultaneously. Learn multiplexing, timeouts, non-blocking operations, and common patterns.

Sync Primitives

When channels are overkill, reach for sync primitives. Learn Mutex, RWMutex, WaitGroup, Once, Cond, and when to use each over channels.

Go Memory Model

Understand happens-before relationships, data races, the race detector, and atomic operations. Essential knowledge for writing correct concurrent code.

Context

Learn how to propagate deadlines, cancellation signals, and request-scoped values through your Go programs using context.Context.

Concurrency Patterns

Practical recipes for common concurrent tasks: worker pools, fan-out/fan-in, pipelines, semaphores, rate limiting, and more.

Testing Concurrent Code

Learn to test concurrent Go code effectively. Master the race detector, synchronization in tests, timeouts, flaky test prevention, and goroutine leak detection.

Performance

Profiling & Benchmarks

Measure and optimize your Go code. Learn benchmarking, CPU and memory profiling, flame graphs, and the trace tool.

Memory & Escape Analysis

Understand stack vs heap allocation, escape analysis decisions, and techniques to reduce allocations for better performance.

GC Optimization

Understand Go's garbage collector, GOGC tuning, GOMEMLIMIT, and how to reduce GC pressure for better performance.

CPU Cache & False Sharing

Understand CPU cache hierarchy, cache lines, false sharing, and memory access patterns for high-performance concurrent code.

Advanced Language Features

Generics

Write type-safe, reusable code without sacrificing performance. Learn type parameters, constraints, and when generics are the right tool.

Reflection

Inspect and manipulate types at runtime. Learn reflect.Type, reflect.Value, struct tags, and when reflection is the right tool.

Code Generation

Generate Go code at build time using go generate, text/template, and AST manipulation. Build type-safe code without runtime overhead.