What this book covers
Chapter 1, Project Organization, covers modules, packages, source tree organization, importing packages, versioning modules, and workspaces.
Chapter 2, Working with Strings, contains recipes showing how to work with strings, internationalization, encoding, regular expressions, parsing, and generating formatted text using templates.
Chapter 3, Working with Date and Time, shows how to work with date, time, and duration values correctly with time zone considerations, formatting/parsing date and time values, performing periodic tasks, and scheduling functions to run later.
Chapter 4, Working with Arrays, Slices, and Maps, introduces the basic container types that are the building blocks for many data structures.
Chapter 5, Working with Types, Structs, and Interfaces, shows how to define new types, extending existing types to share functionality, interfaces, and their uses. In particular, this chapter includes the two approaches to using interfaces, namely, interfaces as contracts and defining interfaces where they are used.
Chapter 6, Working with Generics, introduces the basic recipes for writing generic functions and generic types with examples.
Chapter 7, Concurrency, includes basic recipes to write concurrent programs using goroutines and channels. Mutual exclusion using mutexes is also discussed here.
Chapter 8, Errors and Panics, shows generating errors, passing errors around, handling them, and organizing errors in a project. It also discusses how to generate and deal with panics.
Chapter 9, The Context Package, introduces the Go’s Context which is useful for controlling request lifecycle and passing request-scoped values within an application in a concurrent program.
Chapter 10, Working with Large Data, includes recipes for working with large amounts of data in a concurrent setting using worker pools and concurrent pipelines.
Chapter 11, Working with JSON, includes recipes for encoding and decoding JSON, marshaling/unmarshaling simple and complex data types, working with custom serialization logic, encoding/decoding polymorphic structures, and streaming JSON data.
Chapter 12, Processes, shows how to run and interact with external programs, working with environment variables, working with pipes, and graceful termination using signals.
Chapter 13, Network Programming, gives recipes for TCP and UDP servers and clients, working with TLS, deadlines, HTTP client/servers, request multiplexing, and HTML forms.
Chapter 14, Streaming Input/Output, includes recipes using reads and writers, working with files and the file system, and pipes.
Chapter 15, Databases, shows how to interact with an SQL database using the standard library packages in a secure way.
Chapter 16, Logging, has recipes showing the common uses of the standard library log and slog packages.
Chapter 17, Testing, Benchmarking, and Profiling, gives recipes on writing and running unit tests, testing HTTP servers, benchmarking, and profiling