The Anatomy of Go
The Go internals book

The Anatomy
of Go

Go is a language of simplicity and power — but to truly master it, you need to know what's happening under the hood. Go deep on Go's type system, compiler, memory management, and concurrency model — nothing left as magic.

View the table of contents →

8 chapters · PDF, EPUB & MOBI · One-time purchase, free updates for life

The Anatomy of Go book front cover
What readers are saying

Trusted by Gophers who wanted the full picture.

“This book might be the most precise and in-depth Golang explanation that could ever have been written.”
Meet Gor
Meet Gor Go Developer at Docsumo View source ↗
“Highly recommend it! It goes very very low level. Really enjoyed it!”
Matthias
Matthias Platform Engineer at DE-CIX View source ↗
“The author is one of the best technical writers I've been lucky to come across.”
Matthew James
Matthew James Senior Full Stack Engineer View source ↗
Table of contents

Eight chapters. The whole machine.

The complete book is available now — all 8 chapters, ready to download today in PDF, EPUB, and MOBI. Your purchase includes lifetime access and every future update for free. Click a chapter to see its sections.

Get the book — $45 →
01

Go Thinks Simple Works Better

What makes Go special, the Go way of building software, and how Go actually runs your code.

5
  • What Makes Go Special
  • Good Code Needs More Than Code
  • The Go Way of Building Software
  • Go's Design Decisions
  • How Go Runs Your Code
02

Basic Data Types, Variables, and Constants

Integers, floats, booleans, and pointers as the machine sees them — bit-widths, IEEE-754, memory addresses, and compiler behaviour.

7
  • Integer Types: Bit-Width, Semantics, and System Architecture
  • Floating-Point Types: Precision, Representation, and IEEE-754 Semantics
  • Boolean Type: 1 Byte Memory Representation
  • Pointer Types: Memory Addresses, Dereferencing, and Allocation
  • Variables & Constants: Declarations, Scoping, and Compiler Behavior
  • Bonus: Unsafe Pointers
  • Bonus: Addressable and Unaddressable Values
03

Arrays, Slices, Strings and Maps

The internal structure and runtime behaviour of Go's workhorse data structures.

4
  • Arrays: Fixed-Size Sequences and Memory Semantics
  • Slices: Structure, Semantics, and Behavior
  • Strings: Structure and Behavior
  • Maps: Internal Design and Runtime Behavior
04

Structs, Generics & Interfaces

Composition, memory layout, interface runtime mechanics, and how generics work inside the compiler.

3
  • Structs: Composition, Layout, and Performance
  • Interfaces: Contracts, Composition, and Runtime Mechanics
  • Generics: Type Parameters, Constraints, and Compiler Internals
05

How Does Go Code Turn into Assembly?

Follow the compiler through every stage — syntax tree, type checking, IR, optimization, SSA, and architecture-specific assembly.

8
  • Inspecting the Compilation Process
  • Stage 1: Syntax Tree
  • Stage 2: Type Checking
  • Stage 3: IR Generation
  • Stage 4: Optimization, Dead Code, Devirtualization, Inlining and Escape Analysis
  • Stage 5: Walk
  • Stage 6: Static Single Assignment Form
  • Stage 7: Specific Architecture and Assembly Code
06

Functionality

How defer, panic, and recover really work — plus dead code elimination, inlining, and devirtualization.

6
  • Functionality
  • How Does Defer Work?
  • Panic and Recover
  • Dead Code Elimination
  • Inlining
  • Devirtualization
07

Memory

Stack growth, escape analysis, heap management, and Go's garbage collector.

4
  • Stack: How does it Grow (or shrink)?
  • Escape Analysis
  • Heap Management
  • Garbage Collection
08

Concurrency

Channels, select, timers, the goroutine lifecycle, the scheduler, and how Go handles I/O under the hood.

9
  • Channel
  • Select
  • Timer
  • How does your Application Actually Start?
  • Goroutine Lifecycle
  • Scheduler
  • How Go handles I/O operations
  • Go's Network Poller
  • System Monitoring

sections per chapter

Lifetime access. Free updates, forever.

Buy once and the book is yours. Whenever it's revised or expanded, download the latest version from your account at no extra cost — in PDF, EPUB, and MOBI.

Why this book

Simplicity on the surface. A fascinating machine underneath.

Go hides an enormous amount of engineering behind a small language. This book dives deep into how Go works internally, exploring the mechanisms that make it such an efficient and expressive language — from how your source becomes assembly to how the scheduler juggles a million goroutines.

Whether you're a seasoned Go developer looking to optimize your code or a curious learner eager to grasp Go's underlying elegance, it's filled with detailed explanations and practical examples — an invaluable resource for anyone serious about Go programming.

The author Phuong Le - The Anatomy of Go author

Phuong Le

Phuong Le is a prolific technical writer and an active member of the Go community, with a passion for exploring and explaining Go's inner workings.

Phuong works at VictoriaMetrics, where Go powers their main projects — VictoriaMetrics, a high-performance time series database, and VictoriaLogs, a fast and cost-effective log management solution. Follow him at @func25 for regular Go trivia and deep dives into the language's hidden gems.

Questions, answered

Do I need to be an expert Go programmer to benefit from this book?

While having some experience with Go is helpful, you don't need to be an expert. The book is designed to be accessible to intermediate Go developers who want to deepen their understanding of the language — each concept is explained clearly with practical examples.

How many pages is this book?

The complete book spans 8 in-depth chapters covering Go's type system, data structures, compilation pipeline, runtime functionality, memory model, and concurrency — hundreds of pages of detailed explanations and practical examples.

What format is the book available in?

The book is available in PDF, EPUB, and MOBI formats, making it easy to read on any device. You can download them all if you want.

Is this a one-time purchase?

Yes. Pay once and the book is yours forever — there's no subscription. Your purchase includes every chapter plus all future updates at no extra cost.

Do I get future updates?

Yes. Your purchase includes free lifetime updates. Whenever the book is revised or expanded, you can download the latest version through your account dashboard at no extra cost.

Stop treating Go like magic.

8 chapters on how Go really works — yours to download today, with free updates for life.

The Ultimate Guide to Debugging With Go course cover
If you enjoyed this, you'll also enjoy

The Ultimate Guide to Debugging With Go

Being able to debug locally and in production is a critical skill for any Go engineer, but it is rarely taught explicitly. Accelerate your learning with 50 lessons on debugging Go in the real world.

Get the course — $99 →