📖 Chapter 1 of 20

Introduction to Go

Understand what Go is, why it was created, how it works under the hood, and why millions of engineers worldwide choose it for building production systems.

⏱ — 📊 Beginner 🧩 27 sections 💬 15 interview questions 🧪 2 quizzes

🎯 Learning Objectives

✅ After completing this chapter, you will be able to:
  • Explain what Go is and its position in the programming language landscape
  • Describe the history and design decisions behind Go's creation at Google
  • Compare Go to other languages (C, Java, Python, Rust) with specific, accurate points
  • Explain Go's compilation model and why it produces fast binaries
  • Describe Go's garbage collector at a high level and its impact on latency
  • List Go's core advantages and be honest about its disadvantages
  • Navigate the Go toolchain and understand what each tool does
  • Describe the Go runtime: goroutine scheduler, memory allocator, GC
  • Answer Go introduction interview questions confidently

🐹 What is Go?

Go (also known as Golang) is a statically typed, compiled, garbage-collected, concurrent systems programming language designed at Google. It was created to solve real engineering problems at scale — not as an academic exercise.

The one-sentence definition: Go is a compiled language with the simplicity of Python, the performance of C, the safety of Java, and first-class support for concurrency.

Here's what each of those properties actually means in practice:

Property What it means Real impact
Statically typed Every variable's type is known at compile time Entire class of bugs caught before the program runs
Compiled Source code → native machine code directly Extremely fast startup; single binary deployment
Garbage-collected Runtime automatically reclaims unused memory No manual malloc/free; modern low-latency GC
Concurrent Goroutines + channels built into the language Write concurrent code as simply as sequential code
Open source BSD licence, maintained by Google + community Rich ecosystem, strong backward compatibility guarantees

Go by the Numbers

📅
Released
November 10, 2009 (open source). Go 1.0 released March 28, 2012.
🏢
Creator
Google. Designed by Robert Griesemer, Rob Pike, and Ken Thompson.
🌍
Usage
Top 10 language (TIOBE, Stack Overflow). Used by Google, Uber, Docker, Kubernetes, Cloudflare, Dropbox, GitHub.
⚡
Performance
Typically 2–10× faster than Python/Ruby; within 2× of C for most workloads.

📜 History of Go

Go was born out of frustration. In 2007, engineers at Google were working with enormous codebases written in C++ and Java. Build times were catastrophically long — a full C++ build could take 45 minutes. The code was complex, hard to reason about, and concurrent programming was a nightmare.

💡 The Origin Story

Legend has it that Go was designed during a 45-minute C++ build. Robert Griesemer, Rob Pike, and Ken Thompson sat down in September 2007 and sketched out a language that would fix their frustrations with existing languages.

2007
September 2007
The Whiteboard Meeting
Robert Griesemer, Rob Pike, and Ken Thompson meet to design a new language. Key goals: fast compilation, garbage collection, static typing, concurrency support.
2009
November 10, 2009
Public Announcement
Go is announced publicly. The Go gopher mascot, designed by Renée French, makes its first appearance. The open-source community erupts in excitement.
2012
March 28, 2012
Go 1.0 — The Stability Promise
Go 1.0 ships with a compatibility guarantee: code written for Go 1.0 will compile and run correctly with all future Go 1.x releases. This single promise changed everything for adoption.
2015
August 2015
Go 1.5 — Self-Hosting Compiler
The Go compiler, previously written in C, is rewritten entirely in Go. The runtime, formerly C, is now Go. The language bootstraps itself.
2018
2018
Go Modules Proposal
Russ Cox proposes Go modules as a replacement for GOPATH-based dependency management. Go 1.11 adds experimental support; Go 1.16 makes it the default.
2022
March 2022
Go 1.18 — Generics
The most anticipated Go release ever. Type parameters (generics) arrive after 10+ years of debate. The implementation is carefully designed to avoid runtime overhead for common cases.

The Creators

CreatorBackgroundContribution to Go
Ken Thompson Invented Unix, B (predecessor to C), co-invented UTF-8 Original compiler (translated to Go 1.5), language design
Rob Pike Plan 9, Inferno OS, co-invented UTF-8, worked on Unix Language design, spec, standard library, Go philosophy
Robert Griesemer Worked on V8 (JavaScript engine), Strongtalk, Sawzall Compiler frontend, spec, parser, type checker
🌟 Interview Tip

Interviewers love asking "Who created Go?" The impressive answer names all three creators, mentions their backgrounds (Unix/C heritage), and explains why they created it (slow builds, complex code, poor concurrency support at Google).

🧘 The Go Philosophy

Understanding Go's philosophy is essential — it explains why the language is designed the way it is, and why experienced Go programmers make certain decisions. The Go team is famously opinionated.

Simplicity First

Go has exactly 25 keywords. Python has 35. Java has 67. C++ has over 80. This is not an accident — it's a core design goal. Rob Pike has said repeatedly:

💬 Rob Pike

"Complexity is multiplicative: fixing a problem by making one part of the system more complex slowly makes the whole system more complex."

Go Philosophy PrincipleWhat It Means Practically
One way to do things gofmt enforces one code style; there's no debate about formatting
Explicit over implicit No hidden method calls, no magic, no overloading, no operator overloading
Composition over inheritance No class hierarchy; embed types, implement interfaces implicitly
Errors are values Errors are returned, not thrown; handle them where they occur
Don't communicate by sharing memory; share memory by communicating Use channels to pass data between goroutines instead of shared locks
Fast builds are non-negotiable A million-line Go codebase builds in seconds
Readability is correctness Code is read far more than it is written; Go code reads like prose

The 25 Keywords

Here are all 25 Go keywords — memorise them. This is a common interview question:

go
// Go's complete set of 25 reserved keywords

break        default      func         interface    select
case         defer        go           map          struct
chan         else         goto         package      switch
const        fallthrough  if           range        type
continue     for          import       return       var

Compare this to other languages: Python 3: 35 keywords, Java: 67, C++: 84, Rust: 39. Go's minimal keyword set means less to learn and less cognitive overhead.

❓ Why Does Go Exist?

Go was created to solve three specific problems that Google faced at scale. Understanding these problems helps you understand every design decision in the language.

Problem 1: Compilation Speed

Google's C++ codebase took 45+ minutes to build. Go was designed from the start to compile enormous codebases in seconds. How?

  • No header files: C and C++ require #include directives that cause repeated parsing. Go imports are explicit and compiled once.
  • Strict unused import rule: If you import a package and don't use it, it's a compile error. This prevents bloated dependency graphs.
  • Dependency-free compilation: To compile package A that imports B, you only need the compiled output of B — not all of B's dependencies. This enables parallel compilation.
go
// This will NOT compile — unused imports are a compile error
package main

import (
    "fmt"
    "os"    // ← error: "os" imported and not used
)

func main() {
    fmt.Println("Hello")
    // os is imported but never used — Go refuses to compile this
}
🔴 Compiler Error
./main.go:6:2: "os" imported and not used

Problem 2: Complexity at Scale

Large codebases with many engineers become unmaintainable over time. C++ templates, Java class hierarchies, and Python's dynamic typing all create complexity that grows faster than the codebase. Go's answer:

  • No classes: No inheritance hierarchies that grow out of control
  • Implicit interfaces: Any type can satisfy an interface without declaring it — no coupling between packages
  • One formatter: gofmt means every Go file looks the same, everywhere, always
  • No exceptions: Errors are values; you cannot silently swallow them

Problem 3: Concurrency

Modern servers need to handle thousands of concurrent connections. Threads are expensive (typically 1–8 MB stack each). Callback-based async code (Node.js-style) is hard to reason about. Go's answer: goroutines.

🧵 Thread vs Goroutine Comparison
OS Thread
Stack: 1-8 MB
Context switch: ~1µs
Limit: ~few thousand
Managed by: OS kernel
Go Goroutine
Stack: 2-8 KB initial
Switch: ~100ns
Limit: millions
Managed by: Go runtime
go
// Launching 100,000 goroutines is perfectly normal in Go
// This would crash most systems using OS threads

package main

import (
    "fmt"
    "sync"
)

func main() {
    var wg sync.WaitGroup

    for i := 0; i < 100_000; i++ {
        wg.Add(1)
        go func(id int) {
            defer wg.Done()
            // Each goroutine does work concurrently
            _ = id * 2
        }(i)
    }

    wg.Wait()
    fmt.Println("All 100,000 goroutines completed!")
}
// Memory used: ~800 MB (8KB × 100,000)
// Using OS threads: would require ~100 GB just for stacks
✅ Output
All 100,000 goroutines completed!

⚖️ Advantages & Disadvantages

Every language involves trade-offs. Go is no exception. Understanding what Go does well — and where it falls short — makes you a more effective programmer.

✅ Advantages Detail
Blazing fast compilationLarge codebases compile in 2–10 seconds. Feedback loops are tight.
Single binary deploymentNo VM, no runtime install needed. Cross-compile for any platform. go build → one file.
Lightweight concurrencyGoroutines start with 2KB stack. Millions can run on a single machine.
Excellent standard libraryHTTP server, JSON, crypto, testing, SQL — all in stdlib. Less dependency hell.
Opinionated formattinggofmt eliminates style debates. All Go code looks the same.
Strong toolchainBuilt-in testing, benchmarking, race detection, profiling, documentation.
Backward compatibilityThe Go 1 compatibility promise: your code from 2012 compiles today.
Easy to learn25 keywords. Most developers become productive in Go within 2–4 weeks.
Memory efficientLow-overhead runtime, excellent GC, value types avoid heap pressure.
Built-in race detectorgo run -race main.go detects data races at runtime during testing.
❌ Disadvantages Detail
Verbose error handlingif err != nil { return err } repeated hundreds of times. Divisive in the community.
No generics until Go 1.18Before 2022, you had to use interface{} or code generation. Generics now exist but are still maturing.
GC pausesThe GC can cause occasional latency spikes. Go's GC has improved dramatically but still less predictable than Rust.
No sum types / algebraic typesNo Result<T, E> or pattern matching. This is a real expressiveness gap vs Rust.
No operator overloadingMakes numeric/matrix code more verbose. a.Add(b).Multiply(c) vs a + b * c.
Limited metaprogrammingReflection is verbose and slow; code generation is often the answer.
Immature package ecosystemCompared to npm/PyPI, the Go module ecosystem is smaller. Growing rapidly but gaps exist.

⚙️ How Go Compiles

Understanding how Go compiles code helps you reason about performance, binary sizes, and deployment strategies.

The Compilation Pipeline

🔧 Go Compilation Pipeline
Source (.go files) → Lexer / Parser → AST (Syntax Tree)
→
Native Binary ← Machine Code ← SSA (IR) ← Type Checker
  1. Parsing: The source files are tokenised and parsed into an Abstract Syntax Tree (AST). Go's parser is extremely fast because the grammar is simple and unambiguous.
  2. Type checking: The AST is type-checked. All types are resolved, method calls are verified, interfaces are checked. This is where most Go errors are caught.
  3. Escape analysis: The compiler determines which variables can live on the stack (fast) vs which must escape to the heap (GC-managed).
  4. SSA generation: The AST is converted to Static Single Assignment form — an intermediate representation (IR) used for optimisation.
  5. Optimisation passes: Inlining, dead code elimination, bounds check elimination, and many other optimisations are applied.
  6. Code generation: The SSA IR is translated to machine code for the target architecture (amd64, arm64, etc.).
  7. Linking: All compiled packages are linked into a single binary. The Go runtime (scheduler, GC, stack management) is embedded in the binary.

Static vs Dynamic Linking

shell
// Build a simple program
$ go build -o myapp main.go
$ file myapp
myapp: Mach-O 64-bit executable arm64

// Check binary size
$ ls -lh myapp
-rwxr-xr-x 1.8M myapp   ← includes the Go runtime

// Cross-compile for Linux from macOS
$ GOOS=linux GOARCH=amd64 go build -o myapp-linux main.go

// Inspect what's inside the binary
$ go version -m myapp
myapp: go1.22.0  ← embedded Go version info
🚀 Deployment Superpower

Because Go statically links the runtime and all dependencies, you can build on your Mac and scp the binary directly to a Linux server. No Go installation required on the server. No library conflicts. No "works on my machine" issues. This is one of Go's greatest practical advantages.

🔄 The Go Runtime

Unlike C/C++, Go includes a runtime that is embedded in every binary. This runtime is responsible for three critical subsystems:

SubsystemResponsibilityWhy it matters
Goroutine Scheduler Multiplexes millions of goroutines onto a small number of OS threads (GMP model) Enables massive concurrency without OS thread overhead
Memory Allocator Allocates small objects in size-segregated span classes; large objects directly Faster than malloc; reduces heap fragmentation
Garbage Collector Concurrent tri-color mark-and-sweep GC with minimal STW pauses Automatic memory management with <1ms GC pauses (modern Go)

The GMP Model (Goroutine Scheduler)

The Go scheduler implements the GMP model:

🔧 GMP: Goroutine-Machine-Processor Model
G (Goroutine) — User-level threads managed by Go
G1 (running) G2 (runnable) G3 (waiting) G4 (runnable) G5 (sleeping)
P (Processor) — Local run queues, bounded by GOMAXPROCS
P0
G1 G2 queue
P1
G3 G4 queue
M (Machine) — OS Threads that execute goroutines
Thread 0
(runs P0)
Thread 1
(runs P1)

Garbage Collection in Go

Go uses a concurrent tri-color mark-and-sweep garbage collector. Here's how it works at a conceptual level:

  1. Mark setup (STW, ~100µs): The world is briefly stopped to enable write barriers — tiny hooks that track pointer changes during GC.
  2. Concurrent marking: GC goroutines scan the heap concurrently with your program. Objects are coloured: white (not yet seen), grey (found but children not scanned), black (fully scanned).
  3. Mark termination (STW, ~100µs): Final phase to ensure all objects are accounted for. Very short.
  4. Concurrent sweeping: White objects (unreachable) are swept. Memory is returned to the allocator. Done concurrently — your program keeps running.
📊 GC Performance

Modern Go (1.21+) achieves GC pause times consistently under 1 millisecond, even with heap sizes of many gigabytes. This was achieved through years of incremental improvement. Compare to Java's older GC which could pause for seconds, or Python's GIL which prevents true parallelism.

go
package main

import (
    "fmt"
    "runtime"
)

func main() {
    // Inspect runtime info
    fmt.Printf("Go Version: %s\n", runtime.Version())
    fmt.Printf("OS/Arch:    %s/%s\n", runtime.GOOS, runtime.GOARCH)
    fmt.Printf("CPUs:       %d\n", runtime.NumCPU())
    fmt.Printf("Goroutines: %d\n", runtime.NumGoroutine())

    // Inspect memory stats
    var m runtime.MemStats
    runtime.ReadMemStats(&m)
    fmt.Printf("HeapAlloc:  %d bytes\n", m.HeapAlloc)
    fmt.Printf("NumGC:      %d\n", m.NumGC)
    fmt.Printf("PauseTotal: %d ns\n", m.PauseTotalNs)
}
✅ Example Output
Go Version: go1.22.0 OS/Arch: darwin/arm64 CPUs: 8 Goroutines: 1 HeapAlloc: 208888 bytes NumGC: 0 PauseTotal: 0 ns

🔨 The Go Toolchain

The go command is a powerful Swiss Army knife. Understanding these commands is essential for every Go developer.

Command Purpose Example
go run Compile and run in one step (for development) go run main.go
go build Compile to a binary (for deployment) go build -o server ./cmd/server/
go install Build and install binary to $GOPATH/bin go install github.com/user/tool@latest
go test Run tests, benchmarks, examples go test -v -race ./...
go fmt Format code (runs gofmt internally) go fmt ./...
go vet Static analysis — catches common mistakes go vet ./...
go mod init Initialise a new module (creates go.mod) go mod init github.com/user/project
go mod tidy Remove unused dependencies, add missing ones go mod tidy
go get Add a dependency to go.mod go get github.com/pkg/errors@v0.9.1
go doc Show documentation for a package or symbol go doc fmt.Printf
go generate Run go:generate directives in source files go generate ./...
go env Print Go environment variables go env GOROOT GOPATH GOPROXY

🌍 The Go Ecosystem

Go's ecosystem is one of its strongest assets. Many of the world's most important infrastructure tools are written in Go.

Famous Projects Written in Go

ProjectCategoryWhy it chose Go
DockerContainer runtimeSingle binary, fast startup, excellent system-level APIs
KubernetesContainer orchestrationConcurrency, performance, the same team (Google)
TerraformInfrastructure as CodeCross-platform binary, fast compilation
CockroachDBDistributed SQL databaseConcurrency, performance, GC predictability
etcdDistributed key-value storeConcurrency, Raft consensus implementation
PrometheusMonitoring systemEfficient memory usage, fast time-series processing
HugoStatic site generatorBlazing fast build times (this site would build in 100ms)
CloudflareNetwork infrastructurePerformance, control over memory, GC predictability
GitHub (parts)Developer platformReplacing Ruby services for performance

Where Go Excels

  • 🌐 Web services & APIs — HTTP servers, REST/gRPC microservices
  • 🔧 CLI tools — Single binary, cross-platform, fast startup
  • ☁️ Cloud infrastructure — Kubernetes operators, Terraform providers
  • 🗄️ Databases & storage — CockroachDB, InfluxDB, etcd
  • 🔒 Security tools — Vault, Consul, Packer (all HashiCorp)
  • ⚡ High-performance services — Anything needing low latency + high throughput

Where Go Is Less Suitable

  • 🖥️ GUIs — No mature native GUI toolkit
  • 🤖 Machine Learning — Python + TensorFlow/PyTorch dominate
  • 🎮 Game development — GC pauses and lack of game engines
  • 🔬 Scientific computing — NumPy/SciPy ecosystem is unmatched

✅ Best Practices for New Go Developers

  1. Always run gofmt on your code — or better, configure your editor to run it on save.
  2. Always run go vet before committing — it catches subtle bugs gofmt won't.
  3. Use go mod from day one — never put production code in $GOPATH/src.
  4. Read the official Effective Go guide — it encodes the philosophy of idiomatic Go.
  5. Use the standard library first — Go's stdlib is exceptional. Reach for third-party packages only when the stdlib is genuinely insufficient.
  6. Understand the difference between go run (development) and go build (production).
  7. Learn to read error messages — Go's compiler errors are precise and helpful.

🎤 Interview Questions

1
What is Go and who created it? Why was it created?
▶
Detailed Answer

What: Go is a statically typed, compiled, garbage-collected programming language with built-in concurrency support. It was created at Google by Robert Griesemer, Rob Pike, and Ken Thompson — all of whom have deep roots in Unix/C development.

Why: Three pain points at Google led to Go's creation: (1) C++ build times of 45+ minutes for large codebases; (2) increasing complexity of large multi-engineer codebases; (3) inadequate support for modern multi-core concurrent programming.

Why interviewers ask this: They want to see if you understand Go's design philosophy — not just its syntax. Developers who understand why Go made certain trade-offs write better Go code.

Common wrong answer: "Go was made by Google because it's fast." Too vague — doesn't show understanding of the specific problems Go solves.

Production angle: Go's design choices directly impact your work. Single binary deployment eliminates DevOps complexity. Fast builds enable CI/CD pipelines that run in seconds instead of minutes.

2
How does Go's compilation model differ from Java's? What are the practical implications?
▶
Detailed Answer

Go: Compiles directly to native machine code for the target platform. The output is a self-contained binary that includes the Go runtime. No external runtime installation is needed.

Java: Compiles to bytecode (.class files) that runs on the JVM (Java Virtual Machine). The JVM must be installed on the target machine. JIT compilation happens at runtime.

AspectGoJava
OutputNative binaryJVM bytecode (.jar)
Runtime needed on server❌ No✅ Yes (JRE)
Startup time~1-10ms~100ms-3s (JVM warmup)
Peak throughputGoodVery good (JIT)
Memory footprintLowerHigher (JVM overhead)

Practical implication: Go is significantly better for serverless/Lambda functions (cold starts matter) and container deployments (smaller images, no JDK needed).

3
Explain Go's garbage collector. How does it achieve low-latency pauses?
▶
Detailed Answer

Go uses a concurrent tri-color mark-and-sweep garbage collector. The key innovation is that most GC work happens concurrently with the program rather than stopping it.

Tri-color algorithm: Objects are classified as white (unreachable candidates), grey (reached but children not scanned), or black (fully scanned). The GC starts with all objects white, turns root references grey, then iterates: take a grey object, scan its children, colour them grey, then colour the parent black. When no grey objects remain, all white objects are garbage.

Why concurrent? The program continues running while GC marks objects. Write barriers (tiny code hooks) track any pointer modifications during the mark phase to ensure correctness.

STW (Stop-The-World) phases: Only two very short STW phases: mark setup (~100µs) and mark termination (~100µs). Total STW time is typically <1ms even for multi-GB heaps.

Wrong answer to avoid: "Go has no GC pauses." It has pauses — they're just very short. Saying "no pauses" will hurt your credibility.

4
What are goroutines? How do they differ from OS threads?
▶
Detailed Answer

Goroutines are user-space threads managed by the Go runtime, not the OS kernel. They are Go's fundamental unit of concurrency.

AspectGoroutineOS Thread
Initial stack size2–8 KB (grows/shrinks)1–8 MB (fixed)
Creation cost~1µs, ~3KB memory~100µs, ~1MB memory
Context switch~100ns (user space)~1µs (kernel space)
SchedulingGo runtime (cooperative + preemptive)OS kernel (preemptive)
Practical limitMillionsThousands

GMP Model: The Go scheduler uses the GMP model: G (goroutines), M (OS threads/machines), P (processors/execution contexts). GOMAXPROCS Ps are created (default = number of CPU cores). Each P has a local run queue of goroutines. Ms pick up Ps and run goroutines from their queues.

Key insight: When a goroutine blocks on I/O, the Go scheduler moves other runnable goroutines onto the available M, so the thread is never wasted.

5
Why does Go not have classes or inheritance?
▶
Detailed Answer

Go's designers explicitly rejected classical OOP inheritance because of its well-documented problems at scale: tight coupling between parent and child classes, fragile base class problem, deep hierarchies that become impossible to reason about.

Go instead uses two mechanisms: struct embedding for code reuse (composition), and interfaces for polymorphism (without explicit declaration of intent).

This aligns with a famous software engineering principle: "favour composition over inheritance" (Gang of Four, 1994). Go makes this impossible to violate — there is no inheritance syntax.

Practical benefit: In Go, you never have "I need to break the inheritance hierarchy because requirements changed." You just change which interfaces a type implements, or which types a struct embeds.

🧪 Chapter Quiz

🧩
Introduction to Go — Quiz
5 questions · Test your understanding
1. In what year was Go publicly announced?
2. How many keywords does Go have?
3. What is the initial stack size of a goroutine?
4. Which type of garbage collector does Go use?
5. What is unique about Go's deployment model compared to Java?
—

✏️ Exercises

Exercise 1
Hello, Go World!
⭐ Beginner

Write your first Go program. It should:

  • Print "Hello, Go World!" to stdout
  • Print the current Go version using the runtime package
  • Print the number of available CPU cores
go main.go
package main

import (
    "fmt"
    "runtime"
)

func main() {
    fmt.Println("Hello, Go World!")
    fmt.Printf("Go version: %s\n", runtime.Version())
    fmt.Printf("CPUs available: %d\n", runtime.NumCPU())
}
✅ Expected Output
Hello, Go World! Go version: go1.22.0 CPUs available: 8

Run it with: go run main.go

Exercise 2
Explore the Go Toolchain
⭐ Beginner

In a terminal, run the following commands and note what each one outputs:

  1. go version
  2. go env GOROOT
  3. go env GOPATH
  4. go env GOPROXY
  5. go doc fmt.Println

Write down what each one tells you in your own words.

  • go version → Prints the installed Go version and the target OS/architecture (e.g., go1.22.0 darwin/arm64)
  • go env GOROOT → The directory where Go itself is installed (e.g., /usr/local/go)
  • go env GOPATH → Your workspace directory (e.g., /Users/you/go) — contains downloaded modules
  • go env GOPROXY → The module proxy URL (default: https://proxy.golang.org,direct) — Go downloads dependencies through this
  • go doc fmt.Println → Shows the documentation for the fmt.Println function including its signature and description
Exercise 3
Research Exercise — Go vs Python
⭐⭐ Intermediate

Write a paragraph (3–5 sentences) explaining a scenario where you would choose Go over Python, and a scenario where you would choose Python over Go. Be specific — don't just say "performance." Think about startup time, ecosystem, team experience, problem domain.

Choose Go over Python: Building a high-throughput HTTP API that needs to handle 50,000+ concurrent requests per second with sub-10ms P99 latency, deployed as a Docker container in Kubernetes. Go's goroutine scheduler, low memory overhead, and single binary deployment make it ideal here. Python's GIL prevents true parallelism, and the WSGI/ASGI overhead adds latency.

Choose Python over Go: Training a machine learning model using scikit-learn, PyTorch, or TensorFlow. Python's data science ecosystem (NumPy, Pandas, Matplotlib) is years ahead of anything Go offers. The team already knows Python, and performance is handled by the underlying C/CUDA libraries — not the Python layer.

📋 Summary

Key Takeaways from Chapter 1:

  • Go is a compiled, statically typed, garbage-collected language with built-in concurrency — created at Google in 2007 by Griesemer, Pike, and Thompson
  • It was created to solve: slow C++ builds, complexity at scale, and poor concurrency primitives
  • Go compiles to native machine code and embeds its runtime — enabling single-binary deployments
  • Goroutines start at 2–8 KB (vs 1–8 MB for OS threads) — enabling millions of concurrent tasks
  • The GC is concurrent tri-color mark-and-sweep with <1ms STW pauses
  • Go has 25 keywords and a philosophy of simplicity, explicitness, and composition over inheritance
  • The Go 1 compatibility guarantee (since 2012) means your code remains valid forever

📌 Cheat Sheet

📌 Introduction to Go — Quick Reference
Creators
Robert Griesemer, Rob Pike, Ken Thompson (Google, 2007)
Go 1.0 Released
March 28, 2012
Keywords
25 keywords total
Goroutine stack
2–8 KB initial (grows dynamically)
GC type
Concurrent tri-color mark-and-sweep
GC STW pause
< 1ms (modern Go)
Deployment
Single binary, runtime embedded
Scheduler model
GMP: Goroutine-Machine-Processor

📚 Further Reading