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