Go Fundamentals - Table of Contents
-
Foreword
-
Chapter 1: Modules, Packages, and Dependencies
- Modules
- Packages
- Folders, Files, and Organization
- Importing Packages and Modules
- Dependencies
-
Chapter 2: Go Language Basics
- Language Overview
- Numbers
- Strings
- UTF-8
- Variables
- Constants
- Naming Identifiers
- Printing and Formatting
-
Chapter 3: Arrays, Slices, and Iteration
- List Types: Arrays and Slices
- How Slices Work
- Iteration
-
Chapter 4: Maps and Control Structures
- Maps
- If Statements
- Switch Statements
-
Chapter 5: Functions
- Function Definitions
- Variadic Arguments
- Deferring Function Calls
- Init
-
Chapter 6: Structs, Methods, and Pointers
- Structs
- Methods
- Pointers
- Nil Receivers
-
Chapter 7: Testing
- Testing Basics
- Code Coverage
- Table Drive Testing
- Running Tests
- Test Helpers
-
Chapter 8: Interfaces
- Concrete Types Versus Interfaces
- Explicit Interface Implementation
- Implicit Interface Implementation
- Before Interfaces
- Using Interfaces
- Implementing Interfaces
- Multiple Interfaces
- Asserting Interface Implementation
- The Empty Interface
- Defining Interfaces
- Embedding Interfaces
- Type Assertions
- Assertions Through Switch Statements
- Using Assertions
-
Chapter 9: Errors
- Errors as Values
- Panic
- Don't Panic
- Custom Errors
- Wrapping and Unwrapping Errors
- Errors As/Is
- Stack Traces
-
Chapter 10: Generics
- What are Generics?
- Instantiating Generic Functions
- Defining Constraints
- Multiple Type Constraints
- The Constraints Package
- Type Assertions
- Mixing Method and Type Constraints
- Generic Types
-
Chapter 11: Channels
- Concurrency and Parallelism
- Go's Concurrency Model
- Communicating with Channels
- Unidirectional Channels
- Closing Channels
- Buffered Channels
- Capturing System Signals with Channels
-
Chapter 12: Context
- The Context Interface
- Context Rules
- Context Nodal Hierarchy
- Context Values
- Problems with String Keys
- Securing Context Keys and Values
- Cancellation Propagation with Contexts
- Timeouts and Deadlines
- Context Errors
- Listening for System Signals with Contexts
-
Chapter 13: Synchronization
- Waiting for Goroutines with a WaitGroup
- Error Management with Error Groups
- Data Races
- Synchronizing Access with a Mutex
- Performing Tasks Only Once
-
Chapter 14: Working with Files
- Directory Entries and File Information
- Walking Directories
- Skipping Files and Directories
- Creating Directories and Subdirectories
- File Path Helpers
- Creating Multiple Directories
- Creating Files
- Testing File Walking
- Appending to Files
- Reading Files
- The FS Package
- Using the FS Interface
- Mocking a File System
- Embedding Files