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】
Learn Go by building 12 small, practical projects—from a CLI greeting tool to a gRPC habit tracker and WebAssembly experiments—perfect for busy developers who want hands-on experience with real-world Go patterns, testing, and architecture.
【Book Arc】
- **Opening (~0%–10%)**: Introduces the book's philosophy of learning through small, timed projects, then starts with a simple CLI tool that greets users in multiple languages, teaching basic syntax, maps, and function structure.
- **Early (~10%–23%)**: Builds a bookworm CLI tool that parses JSON book collections, teaching file I/O, JSON decoding, slices vs. arrays, and sorting—plus a logging library project that introduces interfaces, zero values, and closed-box testing.
- **Early-Middle (~23%–39%)**: Develops "Gordle," a Wordle clone, covering rune handling, string manipulation, game state management, and table-driven tests with feedback logic.
- **Middle (~39%–48%)**: Creates a money/currency package that handles decimal precision (avoiding float issues) and fetches exchange rates via HTTP, teaching custom types, error handling, and testing HTTP calls with `httptest`.
- **Late (~48%–75%)**: Covers more advanced projects including a maze exploration tool (overcoming loop constraints, animation) and a gRPC-based habit tracker with Protobuf definitions, code generation, server/client architecture, and unit/integration testing with mocks.
- **Ending (~75%–100%)**: Explores WebAssembly and TinyGo for edge/embedded environments, with appendices on benchmarking, fuzz testing, and database connections.
【Key Takeaways】
- **Learning by doing is the core method** (Early): Each chapter is a self-contained project designed to be completed in a short session, reinforcing concepts through immediate application rather than abstract theory.
- **Slices over arrays in practice** (Early): Arrays have fixed lengths baked into their type, making them inflexible; slices provide dynamic views and are the idiomatic choice for most Go code.
- **JSON handling requires exported fields** (Early): The `encoding/json` package can only decode into exported struct fields, and using `json.Decoder` with `io.Reader` is preferred over `json.Unmarshal` for streaming data.
- **Table-driven tests are a Go best practice** (Early): Structuring tests as maps of cases with expected outcomes makes them readable, maintainable, and easy to extend—as shown in the Gordle feedback tests.
- **Custom types hide implementation details** (Middle): The money package exposes a `Decimal` type while keeping internal representation private, allowing refactoring without breaking the API—a key design principle.
- **Error handling is explicit and deliberate** (Middle): Go uses sentinel errors and error propagation as the primary mechanism for handling failures, with functions returning errors as their last return value.
- **Testing HTTP calls requires mocking** (Middle): The `httptest` package provides a lightweight server for testing HTTP-dependent code without making real network calls, keeping unit tests fast and reliable.
- **Contexts manage request lifecycle** (Late): The gRPC habit tracker demonstrates how `context.Context` carries deadlines, cancellations, and values across API boundaries, essential for production services.
【Reading Tips】
- **Skim the theory sections** (Early): The book weaves in language fundamentals alongside projects; if you're already comfortable with Go basics, focus on the project code and skip ahead to the "why" discussions.
- **Deep-read the testing chapters** (Early–Middle): Testing is a recurring theme—from closed-box testing to table-driven tests and mock generation—so pay close attention to how tests are structured and why.
- **Watch for the "Side Quests"** (Early): These small exercises reinforce concepts and often introduce useful tips (like emoji insertion shortcuts); they're worth doing even if you skip other parts.
- **Type out the code yourself** (All): The authors emphasize writing code manually rather than copying; this builds muscle memory and helps you catch details the text explains.
- **Use the appendices as reference** (Ending): Benchmarking, fuzz testing, and database connections are covered in short tutorials—return to these when you need them in your own projects.
【Coverage Limits】
This guide covers the book's first half in detail (through the money/currency project and HTTP testing). Later chapters on gRPC, WebAssembly, and TinyGo are summarized from the table of contents but not deeply excerpted.
Excerpt 1
xed-width font like this to separate it from ordinary text. In many cases, the original source code has been reformatted; we’ve added line breaks and reworke...
at least two error cases: (1) if the indicated file doesn’t exist, and (2) if the formatting of the file is invalid. Let’s invent a file path that doesn’t ex...
the maximum number of attempts. #2 Asks for a valid word #3 We’ve exhausted the number of allowed attempts. USING EMOJIS To insert emojis, use Ctrl-Cmd-Space...
nformation, that function will be skipped.” This means that you’ll be able to see which test broke, rather than this helper function’s line number. Listing 6...
orce it. #2 Adds some niceties to the default log package Now that we have our basic logger, we can start implementing the server package. We’ll need this lo...
The main well-known mock tools are mockgen (comes with Go), mockify, and minimock, which we used in this chapter. The standard context library provides the C...
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
Learn Go with Pocket-Sized Projects (Final) (Aliénor Latour, Donia Chaiehloudj etc.)(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 to WeChat Moments
Learn Go with Pocket-Sized Projects (Final) (Aliénor Latour, Donia Chaiehloudj etc.)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Learn Go with Pocket-Sized Projects (Final) (Aliénor Latour, Donia Chaiehloudj etc.)(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