Skip to content

Go Programming Textbook

A free, self-paced textbook in 7 chapters. Read a chapter, then drill it with the 170 companion flashcards using spaced repetition.

7 chapters · 170 cards · Updated

Chapters

  1. 1Language Fundamentals and Project Structure

    Go (often called Golang) is an open-source, statically typed, compiled language developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is designed around simplicit...

  2. 2Composite Types and Data Structures

    Slices are the most common composite type in Go. A slice is a flexible, dynamically sized view into an underlying array, and its declaration []int{1, 2, 3} creates one with both le...

  3. 3Functions, Methods, and Interfaces

    Functions in Go are first-class values: they can be assigned to variables, passed as arguments, returned from other functions, and stored in maps. A variadic parameter func sum(num...

  4. 4Error Handling, defer, and Formatting

    Go deliberately avoids exceptions in favor of explicit error returns. Functions that can fail return an error as their last result, and callers are expected to handle it immediatel...

  5. 5Concurrency

    Goroutines are Go's lightweight concurrency primitive. The go keyword starts a function as a goroutine that is multiplexed onto OS threads by the Go runtime, and each starts with o...

  6. 6Standard Library: I/O, Encoding, Web, and Time

    Go's I/O model centers on two interfaces: io.Reader with Read(p []byte) (n int, err error) and io.Writer with Write(p []byte) (n int, err error). Files, network connections, buffer...

  7. 7Testing, Tooling, and Runtime Internals

    Testing is a first-class concern in Go. Test files end in _test.go and import the testing package; tests are functions named TestXxx(t *testing.T) and are run with go test ./.... F...

← Back to the Go Programming deck