Go From Scratch
A full Go language crash course before the networking code starts, capped by a flagship chapter on goroutines, channels, and concurrency.
- Installing Go and Your First ProgramEvery craftsperson remembers the day their first real tool arrived. Not a toy version, not a borrowed one — the actual thing, sitting on the bench, waiting to b…
- Variables, Types, and ConstantsEvery program you will ever write, underneath all its cleverness, is just data being stored, read, and transformed — a value coming in from somewhere, sitting i…
- Functions and MethodsThe previous chapter was about data sitting still — a labeled box, holding a value, refusing to change shape. This chapter is about motion: taking that data and…
- Structs and InterfacesAsk a programmer coming from Java, C++, or Python what they miss most when they first pick up Go, and the honest ones will usually say the same thing: classes.…
- io.Reader, io.Writer, and Streaming DataEvery networked program in Go moves bytes. A TCP connection reads bytes from the network and writes bytes back. An HTTP handler reads a request body and writes…
- Slices, Arrays, and MapsLook back at every code example in the last chapter and a pattern shows up you probably didn't stop to question: []Rectangle , []T , and — a few chapters from n…
- Error Handling in GoIf you've written code in almost any other mainstream language, you've lived with try / catch , and probably been bitten by it at least once — an exception thro…
- Packages, Modules, and go.modEvery program in this book so far has fit comfortably in one file. That won't last, and it shouldn't — a real project needs to split into pieces that different…
- Testing Basics with go testAsk a Go programmer what surprised them most moving from another language, and after "no exceptions" the next answer is often "there's nothing to install to wri…
- Goroutines, Channels, and ConcurrencyEverything in this part of the book so far has been building toward this one chapter, whether or not it said so out loud. Go wasn't designed by people trying to…