Introduction
Installing Go
- Installation
- Writing Code
- Editor Integrations
- (Optional) Linters and Correctness Tooling
Basics
- Program Structure
- Variables and Constants
- Basic Data Types
- Structs
- Operators
- Conditional Statements
- Arrays
- Slices
- Maps
- Loops
- Functions
- Exported Names
- Pointers
- Goroutines
- Channels
- Interfaces
- Error Handling
- Reading Input
- Writing Output
Style and Error Handling
- Style
- Error Handling
- Wrapping Up
Strings
- Appending to Strings
- Splitting strings
- Counting and finding substrings
- Advanced string functions
- Ranging over a string
Supporting Unicode
- A very brief history of string encodings
- Strings are byte slices
- Printing strings
- Runes and safely ranging over strings
- Text Normalization
- Summary
Concurrency
- sync.WaitGroup
- errgroup
- Channels
- Goroutines in web handlers
- Pollers
- Race conditions
Testing
- Why do we need tests?
- Writing Tests
- Testing HTTP Handlers
- Mocking
- Generating Coverage Reports
- Writing Examples
Benchmarks
- A simple benchmark
- Comparing benchmarks
- Resetting benchmark timers
- Benchmarking memory allocations
- Modulo vs Bitwise-and
Tooling
- Godoc
- Go Guru
- Race Detector
- Go Report Card
- Staticcheck
- Go-fuzz
- govalidate
- Pinning tools with Go modules
Security
- Keep Go Up to Date
- CSRF
- HTTP Strict Transport Security (HSTS)
- Content Security Policy (CSP)
- SQL Injection
- See Also
Going into Production
- Continuous Integration & Continuous Deployment (CI/CD)
- Deployment
- Logging
- Monitoring
- Alerting
Further Reading
Acknowledgements
- Licenses