Lesson 1 / 26

Why Go

Built for servers, tools and teams.

Simplicity, speed, concurrency

Go was created at Google for large codebases and networked services. It compiles quickly to a single static binary, has a small language with few ways to do the same thing, garbage collection, built-in concurrency (goroutines and channels), and a strong standard library (HTTP, JSON, crypto, testing). Tooling (formatting, testing, vetting, profiling) ships with the language. Go powers much cloud infrastructure, including Docker, Kubernetes and Terraform.

Simple language, fast tools

Go is a compiled, statically typed language designed for simplicity, fast builds and concurrency.

Three ideas: why Go, the toolchain, modules and packages.
Figure 1.1 — Language, toolchain and modules.

A well-organised workshop

Fewer, well-chosen tools that everyone uses the same way make it easy for any team member to pick up anyone else's work.

Embrace the conventions

Go favours one formatting style, explicit errors and small interfaces; working with these conventions makes code instantly familiar to other Go developers.

Quick check: What does a Go build typically produce?

  • Java bytecode
  • A folder of interpreted scripts
  • A single compiled binary
  • A Docker image automatically
Answer

A single compiled binary — Static binaries are easy to deploy.