Go by Example cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

welcome

 

Thanks for purchasing the MEAP of Go by Example: Programmer's Guide to Idiomatic and Testable Code.

This book is full of practical Go tips and common mistakes to avoid.

Since the previous MEAP update, significant improvements have been made:

  • Chapters and visuals have been entirely redesigned for better clarity.
  • A Go crash course has been included in the appendices for beginners.
  • All code examples are updated for Go version 1.24.2, covering iterators, new benchmarking techniques, and more.

Although extensively revised, the book's promise remains the same:

  • Helping you acquire the right mindset to write idiomatic, maintainable, and testable Go code.
  • Demonstrating idiomatic Go through realistic project examples.
  • Here's a concise roadmap:
  • Chapter 1 introduces the book's goals and highlights what makes Go unique.
  • Chapters 2 and 3 focus on testing and benchmarking to cultivate the mindset necessary for the rest of the book.
  • Chapter 4 covers writing command-line programs.
  • Chapter 5 discusses dependency injection techniques.
  • Chapter 6 shows how to structure concurrent programs.
  • Chapter 7 explores writing responsive and efficient programs.
  • Chapter 8 dives into structuring packages effectively to avoid import cycles.
  • Chapter 9 explains how to write composable code.
  • Chapter 10 demonstrates the idiomatic use of interfaces through practical examples involving SQL databases.
  • Appendices A to E introduce Go fundamentals, such as pointers and related idiomatic principles.
sitemap