Go by Example
eBook - ePub

Go by Example

Programmer's guide to idiomatic and testable code

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Go by Example

Programmer's guide to idiomatic and testable code

About this book

Go beyond Go syntax into the language’s unique perspective on program design.

Through engaging hands-on examples, Go by Example will teach you to think differently about programming in Go. You’ll get to grips with the “Go mindset”, writing code that’s simple, straightforward, and easy to understand for your fellow Go developers. You’ll discover how Go’s tooling helps you write code that’s robust and testable, and see just how productive you can be with Go's rich set of built-in packages.

In Go by Example you will learn how to:

• Understand what makes Go different and adopt its philosophy for simple, pragmatic, and straightforward code
• Write idiomatic code that’s robust, efficient, maintainable, and inherently testable by design
• Identify common Go mistakes and apply proven patterns for higher quality code
• Structure and organize effective Go packages and APIs
• Build performant concurrent programs with Go’s unique concurrency

Go by Example explores what makes Go so dramatically different from other languages. Through hands-on and realistic project examples—like command-line tools, web services, and scalable concurrent programs—it helps experienced developers unlearn habits and quickly become productive in crafting truly Go-like, high-quality code.

About the technology

You can’t appreciate the simplicity, explicitness, and pragmatism of Go until you see it with your own eyes! Even a quick glance at an elegant interface or a bit of clean error handling code reveals why Go was the language of choice for Kubernetes, Docker, and Terraform.

About the book

Go by Example unpacks real Go programs to highlight the language features and idiomatic coding practices used by the pros. In it, you’ll dissect and explore examples of command-line tools, concurrent programs, web services, and more as you learn to write Go code that’s simple, efficient, and testable.

What's inside

• Acquire the “Go mindset”
• Write idiomatic, reliable, and maintainable code
• Structure Go projects and packages
• Best practices and antipatterns

About the reader

For experienced programmers.

About the author

Inanc Gumus is a veteran programmer who has specialized in Go since 2012. Inanc has educated over 100,000 developers through his social presence, GitHub repositories, online courses, and his popular blog.

Table of Contents

1 Getting started
2 Idioms and testing
3 Test coverage and optimization
4 Command-line interfaces
5 Dependency injection
6 Synchronous APIs for concurrency
7 Responsive and efficient programs
8 Structuring packages and services
9 Composition patterns
10 Polymorphic storage

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Publisher
Manning
Year
2025
eBook ISBN
9781638357667

Table of contents

  1. Go by Example Programmer’s guide to idiomatic and testable code
  2. copyright
  3. contents
  4. dedication
  5. preface
  6. acknowledgments
  7. about this book
  8. about the author
  9. about the cover illustration
  10. 1 Getting started
  11. 2 Idioms and testing
  12. 3 Test coverage and optimization
  13. 4 Command-line interfaces
  14. 5 Dependency injection
  15. 6 Synchronous APIs for concurrency
  16. 7 Responsive and efficient programs
  17. 8 Structuring packages and services
  18. 9 Composition patterns
  19. 10 Polymorphic storage
  20. appendix A  Modules and packages
  21. appendix B  Variables and pointers
  22. appendix C  Arrays, slices, and maps
  23. appendix D  Object-oriented programming
  24. appendix E  Concurrent programming
  25. appendix F  Self-referential options
  26. appendix G  Cross-compiling Go programs

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Go by Example by Inanc Gumus in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation. We have over one million books available in our catalogue for you to explore.