Gopher Reading List
Here is a reading list of blog posts about Go. It aspires to include only the most useful and relevant material that anyone writing Go should eventually read. By definition, the list is a work in progress.
Rather than being comprehensive, the list is a curated selection fixed at 200 entries.
Go is growing fast and so are the number of blog posts about it. If an interested reader knows of a great post not on this list, please open an issue with a link to the post. Not every blog post linked in an issue will make its way into the list. Nonetheless, the issue list (both open and closed) is a good source of additional reading material.
NOTE: Any new additions will need to replace something else on the list to keep it at a fixed length.
Start Here
- Why should you learn Go?
- An Intro to Go for non-Go developers
- How to Write Go Code
- A Tour of Go
- Frequently Asked Questions
- Go by Example
- Go 101
See Go Books for a list of books, both free and paid.
Beginner
Some basics
- Understand Go pointers in less than 800 words or your money back
- Don't fear the pointer
- Channel Axioms
- Golang channels tutorial
- Common Gotchas in Go
- 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs
- Slices from the ground up
- 6 Tips for Using Strings in Go
- Go Defer Simplified with Practical Visuals
- How to Use Go Interfaces
- Different Ways to Initialize Go structs
Worth reading, again and again
- Effective Go
- Visualizing Concurrency in Go
- Strings, bytes, runes and characters in Go
- Arrays, slices (and strings): The mechanics of 'append'
Organization and Style
- Practical Go: Real world advice for writing maintainable Go programs
- Less is exponentially more
- Go Proverbs
- Code Review Comments
- Idiomatic Go
- Error handling and Go
- Working with Errors in Go 1.13
- Simple Go project layout with modules
- Structuring Tests in Go
- Standard Package Layout
- Packages as layers, not groups
- Structuring Applications in Go
- Style guideline for Go packages
- Package names
- What's in a name (slides)
Web
- Creating My First Web Application with Go
- Making a RESTful JSON API in Go
- Serving static files and web apps in Go
- An Intro To Templates in Go
- JSON APIs Are Just Web Applications
- Writing middleware in #golang and how Go makes it so much fun
- Go and JSON
- Accessing data in Go
- How to Use //go:embed
Concurrency
Go Modules
Intermediate
Code Design
- Go best practices, six years in
- Aspects of a good Go library
- Solid Go Design
- Go for Industrial Programming
- Failure is your Domain
- What “accept interfaces, return structs” means in Go
- Pitfalls of context values and how to avoid or mitigate them in Go
- How to organize the go struct, in order to save memory
- Loose Coupling in Go lang
- Self-referential functions and the design of options
- Functional Options for Friendly APIs
- Functional Options on Steroids
- Error handling in Upspin
- Passing Loggers in Go: Golang Logging Best Practices
- errors.Join
❤️ defer
Concurrency
- Concurrency Patterns
- Stopping goroutines
- Make Ctrl+C cancel the context.Context
- How to correctly use context.Context in Go 1.7
- Using contexts to avoid leaking goroutines
- Go Concurrency Patterns: Pipelines and cancellation
- Tutorial: Synchronizing State with Mutexes in Go
- Context and Cancellation of goroutines
- Dancing with Go's Mutexes
- GoRoutines, Channels, and Proper Exits
- How to Block Forever in Go
- Mutex Profile
- Sane Concurrency with Go
- Error handling patterns in Go
- Does the race detector catch all data races?
- Interesting ways of using Go channels
- Code Review Checklist: Go concurrency
- The Pros of Conds
- Go concurrency guide
Testing
- Testing Web Apps in Go
- An Introduction to Testing in Go
- 5 simple tips and tricks for writing unit tests in #golang
- 5 Advanced Testing Techniques in Go
- Interfaces and Composition for Effective Unit Testing in Golang
- Go Testing Technique: Testing JSON HTTP Requests
- Testing Your (HTTP) Handlers in Go
- Learn Go with tests
- Lesser-Known Features of Go Test
- When Writing Unit Tests, Don’t Use Mocks
- Property-based testing in Go
- Functional table-driven tests in Go
- Advanced Testing in Go
Web
- Go for Cloud
- Exposing Go on the Internet
- The complete guide to Go net/http timeouts
- HTTP(S) Proxy in Golang in less than 100 lines of code
- Write a Kubernetes-ready service from zero step-by-step
- A brief intro of TCP keep-alive in Go’s HTTP implementation
- Build a Web Crawler in Go
- Your pprof is showing: IPv4 scans reveal exposed net/http/pprof endpoints:
- HTTP Request Contexts & Go
- Using Object-Oriented Web Servers in Go
- Handle HTTP Request Errors in Go
- Don't use Go's default HTTP client (in production)
- Writing an API Client in Go
- Seeking around in an HTTP object
- Using Functions Inside Go Templates
- Practical Persistence in Go: Organising Database Access
- How I write Go HTTP services after seven years
- Make resilient Go net/http servers using timeouts, deadlines and context cancellation
- Life of an HTTP request in a Go server
- Gotchas in the Go Network Packages Defaults
- Graceful shutdown of a TCP server in Go
- How to handle signals with Go to graceful shutdown HTTP server
JSON
- Go JSON Cookbook
- Custom JSON Marshalling in Go
- Advanced Encoding and Decoding Techniques
- Go json.Decoder Considered Harmful
Tools
- An Overview of Go's Tooling
- Go tooling essentials
- Profiling Go Programs
- Go Tooling in Action
- Statically compiling Go programs
- Tutorial: Getting started with fuzzing
- Go mod's lesser known features
- A comprehensive guide to go generate
Trivia
- 10 things you (probably) don't know about Go
- Advanced Go Tips And Tricks
- Golang slices gotcha
- a[low:high:max] in Golang — A Rare Slice Trick
Performance
- Diagnostics
- Profiling Go
- Five things that make Go fast
- Debugging Go Applications using Delve
- Easy memory-saving tricks in Go
Language
- Golang: pass by pointer vs pass by value
- There is no pass-by-reference in Go
- Variadic functions in Go
- Function Types in Go (golang)
- research!rsc: Go Data Structures
- The Relationship Between Interfaces and Reflection
- Darker Corners of Go
Generics
Miscellaneous
- Always Be Closing
- Don't defer Close() on writable files
- How to Use go:generate
- Writing worker queues, in Go
- Job Queues in Go - OpsDash
- Reading files in Go
- Vanity Go Import Paths
- Tags in Golang
- Handling Errors from Deferred Functions in Go
- Bitmasks for nicer APIs
- A Comprehensive Guide to Structured Logging in Go
Advanced
Low Level Concerns
- The Go Memory Model
- Go's work-stealing scheduler
- The Go scheduler
- Illustrated Tales of Go Runtime Scheduler
- Go: Asynchronous Preemption
- Go Assembly by Example
- Address Alignments in Go
- Hacking the Scheduler
- Scheduling In Go - Part II
- Anatomy of a function call in Go
- Scheduler Tracing in Go
- unsafe.Pointer and system calls
- Type-Unsafe Pointers
- Looking at your program’s structure in Go 1.7
- Managing Syscall Overhead with crypto/rand
- Go: Introduction to the Escape Analysis
- Monkey Patching in Go
- Interface method calls with the Go register ABI
Performance
- Allocation Efficiency in High-Performance Go Services
- Handling 1 Million Requests per Minute with Go
- Go code refactoring : the 23x performance hunt
- A Million WebSockets and Go
- go-perfbook
- Simple techniques to optimise Go programs
- High Performance Go Workshop
- Reducing Memory Allocations in Golang
Garbage Collection
- A Guide to the Go Garbage Collector
- Getting to Go: The Journey of Go's Garbage Collector
- Avoiding high GC overhead with large heaps
- How to Optimize Garbage Collection in Go
- Garbage Collection in Go