Chapter 2: Go Language Essentials
In the previous chapter, we covered the basics of the Go language. While some of the syntax is new in relation to other languages, most of the concepts in that chapter are familiar to programmers coming from other languages.
This isn't to say that the way Go uses those concepts doesn't lead to code that is easier to read and reason about—it's just that most of it doesn't stand out from other languages.
In this chapter, we will be discussing the essential parts of Go that make it stand out from other languages, from Go's more pragmatic error handling to its core concurrency concept, the goroutine, and the newest feature of the Go language, generics.
Here are the main topics that will be covered:
- Handling errors in Go
- Utilizing Go constants
- Using
defer
,panic
, andrecover
- Utilizing goroutines for concurrency
- Understanding Go's
Context
type - Utilizing Go's testing framework...