If you are reading this book, we assume you are interested in running Go in a production environment. Maybe you dabble in Go on your side projects, but are wondering how you can use it at work. Or perhaps you’ve read a company blog post about converting their codebase to Go, which now has 3 times less code and response times one tenth of what they were before. Your mileage will vary when it comes to gains in productivity and efficiency, but we think they will be positive gains. Our goal in writing this book is to provide the knowledge to write a production-ready service in Go. This means not only writing the initial implementation, but also reliably deploying it, monitoring its performance, and iterating on improvements.
Go is a language that allows for fast iteration, which goes well with continuous deployment. Although Go is a statically typed language, it compiles quickly and can often be used as a replacement for scripting languages like Python. And many users report that when writing Go, once a program works, it continues to “just work”. We suspect that this is due to the simple design of the language, and the focus on readability rather than clever constructs.
In one project, we replaced existing APIs in PHP with equivalent functionality in Go. We saw performance improvements, including an order of magnitude reduction in response times, which led to both higher user retention and a reduction in server costs. We also saw developer happiness increase, because the safety guarantees in Go reduced the number of production-breaking bugs.
This book is not meant for beginner programmers. We expect our audience to be knowledgeable of basic computer science topics and software engineering practices. Over the years, we have helped ramp up countless engineers who had no prior experience writing Go. Ideally this will be the book that people recommend to engineers writing Go for the first time, and who want to better understand the “right way” to write Go.
We hope this book
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical field guide for experienced programmers who already know how to code but need to learn the "right way" to write, deploy, and operate Go services in production. It bridges the gap between side-project Go and the reliability, tooling, and operational discipline that real systems demand.
【Book Arc】
- **Opening (~0%–9%)**: Makes the case for Go in production — fast iteration, quick compilation, readability over cleverness — and sets expectations: this is not for beginners, but for engineers who want to write production-ready services, not just working code.
- **Early (~9%–34%)**: A rapid but opinionated tour of Go fundamentals: packages and program structure, variables, structs, slices, maps, loops, functions, pointers, goroutines, channels, interfaces, and error handling. The goal is to surface common pitfalls and answer questions even experienced Go programmers still have.
- **Middle (~34%–50%)**: Shifts from syntax to craft — style and error handling. Covers gofmt's strict formatting philosophy, short variable names, golint, and the idiomatic `if err != nil` pattern, explaining why Go's constraints are features rather than annoyances.
- **Late (~50%+)**: Moves into production concerns beyond the initial implementation — deployment, monitoring, profiling, and iterating on improvements. The excerpts do not cover these chapters in detail, but the introduction explicitly promises them.
- **Ending**: The book closes the loop from "writing Go" to "running Go in production," treating deployment, observability, and iteration as first-class parts of the engineering workflow rather than afterthoughts.
【Key Takeaways】
- **Go's simplicity is a production advantage, not a limitation** (Opening): Fast compilation, readability over clever constructs, and safety guarantees reduce production-breaking bugs and increase developer happiness — one team reported an order-of-magnitude response-time improvement after replacing PHP APIs with Go.
- **This book assumes you already know how to program** (Opening): It targets engineers knowledgeable in computer science and software engineering who are new to Go or want to understand the "right way" to write it — not beginners learning to code.
- **gofmt's strictness is a feature** (Middle): By eliminating formatting debates and making everyone's code look the same, gofmt lowers the cognitive cost of reading others' code and helped accelerate Go's community and standard-library growth.
- **Short variable names are idiomatic in context** (Middle): Go's source code favors terse names like `d` for local, short-lived variables — a deliberate trade-off that experienced Go developers accept, even if it contradicts conventional naming advice.
- **Error handling is explicit and repetitive by design** (Middle): The ubiquitous `if err != nil` pattern may frustrate newcomers, but it forces callers to confront failure paths rather than hide them — a core part of Go's production-safety story.
- **Concurrency primitives are lightweight but require discipline** (Early): Goroutines are cheap, and channels plus `sync.WaitGroup` manage them — but the excerpts warn that `WaitGroup` requires knowing the exact goroutine count ahead of time, or you risk deadlocks.
- **Production readiness spans the full lifecycle** (Opening): The book's stated goal is not just initial implementation but reliable deployment, performance monitoring, and iterative improvement — the operational half of shipping Go services.
- **Tooling enforces correctness, not just style** (Early): Tools like `go vet` catch real bugs (e.g., wrong `Printf` format verbs) that compile and run fine, while linters like `gometalinter`, `deadcode`, `ineffassign`, and `misspell` catch issues before they reach production.
【Reading Tips】
- **Skim the Basics chapter if you already write Go** — but don't skip it entirely. The authors explicitly say even experienced Go programmers should read it for the pitfall examples and answers to common questions.
- **Deep-read the style and error-handling sections** (~34%–50%). These are where the book's opinionated "right way" philosophy lives, and they shape everything that follows.
- **Treat the concurrency examples as starting points, not templates.** The goroutine example uses `time.Sleep` as a placeholder and the authors explicitly say it should not be considered valid goroutine management — pay attention to the `WaitGroup` and channel patterns instead.
- **Read the production chapters with your own deployment pipeline in mind.** The excerpts don't detail them, but the book's value proposition is operational, so map its advice onto your actual deploy, monitor, and iterate loop.
- **Use the tooling recommendations as a checklist.** `gofmt`, `go vet`, `golint`, and `gometalinter` are concrete, actionable additions to any Go project's CI.
【Coverage Limits】
The excerpts cover the introduction, installation/tooling, basics, and style/error-handling chapters in detail, but the later production chapters on deployment, monitoring, profiling, and iteration are only previewed in the introduction — this guide cannot summarize their specific content.
Page 6
countless engineers who had no prior experience writing Go. Ideally this will be the book that people recommend to engineers writing Go for the first time, a...
ver programmed in Go before, this chapter will give you the knowledge to start reading and writing simple Go programs. Even if you have programmed in Go befo...
2, 3, 4, 5} 2 y := x[3:] 3 fmt.Println(y) and we get: [4 5] A slice’s zero value is nil: Basics 26 1 x := []int{1, 2, 3} 2 y := []int{} 3 fmt.Println("y capa...
source code, you’ll see a lot of code that looks like this: 1 func Unmarshal(data []byte, v interface{}) error { 2 // Check for well-formedness. 3 // Avoids...
e Go language - for now, just think of them as more or less equivalent to a single character, like char in Java. In isNotLetter, we return false if the passe...
g the same map concurrently, however, there is a data race. We can prevent this by using sync.Map: Concurrency 79 sync.Map 1 package main 2 3 import ( 4 "log...
ird party library. Perhaps this library is a client library to an external API, or perhaps it performs database operations. In your unit tests, it is best to...
all the benchmark functions, we can simply provide -bench=.. go test will first run all the tests (or those matched by -run, if provided), and then run the b...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Production Go. Build modern, production-ready systems in Go (Herman Schaaf, Shawn Smith)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Production Go. Build modern, production-ready systems in Go (Herman Schaaf, Shawn Smith)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment