Video description
In Video Editions the narrator reads the book while the content, figures, code listings, diagrams, and text appear on the screen. Like an audiobook that you can also watch as a video.
Spot errors in your Go code you didn’t even know you were making and boost your productivity by avoiding common mistakes and pitfalls.
100 Go Mistakes and How to Avoid Them shows you how to:
- Dodge the most common mistakes made by Go developers
- Structure and organize your Go application
- Handle data and control structures efficiently
- Deal with errors in an idiomatic manner
- Improve your concurrency skills
- Optimize your code
- Make your application production-ready and improve testing quality
100 Go Mistakes and How to Avoid Them puts a spotlight on common errors in Go code you might not even know you’re making. You’ll explore key areas of the language such as concurrency, testing, data structures, and more—and learn how to avoid and fix mistakes in your own projects. As you go, you’ll navigate the tricky bits of handling JSON data and HTTP services, discover best practices for Go code organization, and learn how to use slices efficiently.
About the Technology
Understanding mistakes is the best way to improve the quality of your code. This unique book examines 100 bugs and inefficiencies common to Go applications, along with tips and techniques to avoid making them in your own projects.
About the Book
100 Go Mistakes and How to Avoid Them shows you how to replace common programming problems in Go with idiomatic, expressive code. In it, you’ll explore dozens of interesting examples and case studies as you learn to spot mistakes that might appear in your own applications. Expert author Teiva Harsanyi organizes the error avoidance techniques into convenient categories, ranging from types and strings to concurrency and testing.
What's Inside
- Identify and squash code-level bugs
- Avoid problems with application structure and design
- Perfect your data and control structures
- Optimize your code by eliminating inefficiencies
About the Reader
For developers proficient with Go programming and syntax.
About the Author
Teiva Harsanyi is a senior software engineer at Docker with experience in various domains, including safety-critical industries like air traffic management.
Quotes
Required reading for Go developers before they touch code in production. It’s the Go equivalent of Effective Java.
- Neeraj Shah, Nutanix
Clear and effective examples. Armed with the understanding of how and why mistakes occur, you’re equipped to avoid costly errors.
- Giuseppe Maxia, Vmware
Teiva Harsanyi catalogs real problems and easy-to-miss ‘gotchas,’ and delves into the nuanced world of why they happen. Not having this book will be your 101st mistake.
- Anupam Sengupta, Red Hat
Learn good habits by identifying bad ones. The writing is engaging, the examples relevant, and the insights useful.
- Thad Meyer, LI-COR Biosciences
Narrated by Christopher Kendrick.
Table of contents
- Chapter 1. Go: Simple to learn but hard to master
- Chapter 1. 100 Go mistakes
- Chapter 2. Code and project organization
- Chapter 2. #3: Misusing init functions
- Chapter 2. #5: Interface pollution
- Chapter 2. Interface pollution
- Chapter 2. #7: Returning interfaces
- Chapter 2. #9: Being confused about when to use generics
- Chapter 2. #10: Not being aware of the possible problems with type embedding
- Chapter 2. #11: Not using the functional options pattern
- Chapter 2. #12: Project misorganization
- Chapter 2. #14: Ignoring package name collisions
- Chapter 2. #16: Not using linters
- Chapter 3. Data types
- Chapter 3. #19: Not understanding floating points
- Chapter 3. #20: Not understanding slice length and capacity
- Chapter 3. #21: Inefficient slice initialization
- Chapter 3. #22: Being confused about nil vs. empty slices
- Chapter 3. #24: Not making slice copies correctly
- Chapter 3. #26: Slices and memory leaks
- Chapter 3. #27: Inefficient map initialization
- Chapter 3. #28: Maps and memory leaks
- Chapter 3. #29: Comparing values incorrectly
- Chapter 4. Control structures
- Chapter 4. #31: Ignoring how arguments are evaluated in range loops
- Chapter 4. #32: Ignoring the impact of using pointer elements in range loops
- Chapter 4. Map insert during iteration
- Chapter 5. Strings
- Chapter 5. #37: Inaccurate string iteration
- Chapter 5. #39: Under-optimized string concatenation
- Chapter 5. #41: Substrings and memory leaks
- Chapter 6. Functions and methods
- Chapter 6. #43: Never using named result parameters
- Chapter 6. #45: Returning a nil receiver
- Chapter 6. #47: Ignoring how defer arguments and receivers are evaluated
- Chapter 7. Error management
- Chapter 7. #50: Checking an error type inaccurately
- Chapter 7. #52: Handling an error twice
- Chapter 7. #54: Not handling defer errors
- Chapter 8. Concurrency: Foundations
- Chapter 8. #56: Thinking concurrency is always faster
- Chapter 8. Parallel merge sort
- Chapter 8. #58: Not understanding race problems
- Chapter 8. The Go memory model
- Chapter 8. #59: Not understanding the concurrency impacts of a workload type
- Chapter 8. #60: Misunderstanding Go contexts
- Chapter 8. Catching a context cancellation
- Chapter 9. Concurrency: Practice
- Chapter 9. #63: Not being careful with goroutines and loop variables
- Chapter 9. #65: Not using notification channels
- Chapter 9. #67: Being puzzled about channel size
- Chapter 9. #68: Forgetting about possible side effects with string formatting
- Chapter 9. #70: Using mutexes inaccurately with slices and maps
- Chapter 9. #72: Forgetting about sync.Cond
- Chapter 9. #73: Not using errgroup
- Chapter 9. #74: Copying a sync type
- Chapter 10. The standard library
- Chapter 10. #77: Common JSON-handling mistakes
- Chapter 10. #78: Common SQL mistakes
- Chapter 10. #79: Not closing transient resources
- Chapter 10. #80: Forgetting the return statement after replying to an HTTP request
- Chapter 10. HTTP server
- Chapter 11. Testing
- Chapter 11. #83: Not enabling the -race flag
- Chapter 11. #85: Not using table-driven tests
- Chapter 11. #87: Not dealing with the time API efficiently
- Chapter 11. #88: Not using testing utility packages
- Chapter 11. #89: Writing inaccurate benchmarks
- Chapter 11. Not being careful about compiler optimizations
- Chapter 11.9 #90: Not exploring all the Go testing features
- Chapter 12. Optimizations
- Chapter 12. Slice of structs vs. struct of slices
- Chapter 12. Cache placement policy
- Chapter 12. #92: Writing concurrent code that leads to false sharing
- Chapter 12. #93: Not taking into account instruction-level parallelism
- Chapter 12. #94: Not being aware of data alignment
- Chapter 12. #95: Not understanding stack vs. heap
- Chapter 12. #96: Not knowing how to reduce allocations
- Chapter 12. #97: Not relying on inlining Part 1
- Chapter 12. #97: Not relying on inlining Part 2
- Chapter 12. #97: Not relying on inlining Part 3
- Chapter 12. #99: Not understanding how the GC works
- Chapter 12. #100: Not understanding the impacts of running Go in Docker and Kubernetes
Product information
- Title: 100 Go Mistakes and How to Avoid Them, Video Edition
- Author(s):
- Release date: September 2022
- Publisher(s): Manning Publications
- ISBN: None
You might also like
book
100 Go Mistakes and How to Avoid Them
Spot errors in your Go code you didn’t even know you were making and boost your …
video
Go in Action video edition
"A concise and comprehensive guide to exploring, learning, and using Go." From the Foreword by Steve …
video
Microservices Patterns Video Edition
"A comprehensive overview of the challenges teams face when moving to microservices, with industry-tested solutions to …
book
Head First Git
What will you learn from this book? Many people who use Git rely on "recipes"--copying and …